{"_id":"alfresco-js-api","_rev":"298-3e51ae3b4d02bb48db19dd4c85c17c9b","name":"alfresco-js-api","description":"JavaScript client library for the Alfresco REST API","dist-tags":{"latest":"3.0.0-14a975b4461542cd2e108addd613a813313d32e8","beta":"3.0.0-beta7","alpha":"2.7.0-2a84d662e8134ada8923742adad17351a4a2f777","next":"3.0.0-delta1"},"versions":{"0.1.0":{"name":"alfresco-js-api","version":"0.1.0","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"bundle.d.ts","scripts":{"test":"./node_modules/mocha/bin/mocha --recursive","generate":"mvn clean generate-sources","bundle":"./node_modules/browserify/bin/cmd.js main.js -o bundle.js"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/dev-platform-rest-api.git"},"bugs":{"url":"https://github.com/Alfresco/dev-platform-rest-api/issues"},"dependencies":{"superagent":"1.7.1"},"devDependencies":{"browserify":"^13.0.1","expect.js":"~0.3.1","mocha":"~2.3.4","sinon":"1.17.3"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"}],"keywords":["alfresco"],"gitHead":"f6687984b91db4d04f01ee537ec9d5ffb22f405e","homepage":"https://github.com/Alfresco/dev-platform-rest-api#readme","_id":"alfresco-js-api@0.1.0","_shasum":"108345acf6214ea6d79710053cf8cd9b1b11e36c","_from":".","_npmVersion":"3.10.2","_nodeVersion":"5.10.1","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"108345acf6214ea6d79710053cf8cd9b1b11e36c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.1.0.tgz","integrity":"sha512-qzkerDBpoxkrcHxv4ok7zNflAckkVC738v82GlRM9nx6REa9Qsy3KPyTRySmE/Ur0YG9PhFtJonU+wtJ001ZbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfEJ2GqrLIF8NypJIUkjoIvXH4KY84WiYh7hBCoFc/UwIhALxLS/aeQNSuFPQU7+3BdX41zp1wd0EzDBQNE/Jmo00R"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.1.0.tgz_1467234380951_0.8723676945082843"},"directories":{}},"0.2.0":{"name":"alfresco-js-api","version":"0.2.0","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run bundle","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1"},"devDependencies":{"browserify":"^13.0.1","chai":"^3.5.0","event-emitter":"^0.3.4","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","lodash":"^4.13.1","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"^7.7.3","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"}],"keywords":["alfresco"],"gitHead":"1cb189fbbf46c42a7f5d4ddbed8c3f36a1b4a054","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.2.0","_shasum":"a46bf5f49fbb756de09d4393b92a18b3dd3cc29e","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"a46bf5f49fbb756de09d4393b92a18b3dd3cc29e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.2.0.tgz","integrity":"sha512-JLcVBVX+uCQXjSKB6o80FGg+wvNKuQy3fTAOyeZY9t0Jk6RDzfcxx2kNCRpkh29kNEWpDNzLJT3DCdoZEb3Usw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCVLqNpxnpajj2bExUoUrUZourgz4yJGnM34Mgu9fr8AiEA+zwX7477uvxTgSzWvLViuqFDvkILeeJGhpD7gFIOy4Q="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.2.0.tgz_1468013755399_0.4675690389703959"},"directories":{}},"0.2.1":{"name":"alfresco-js-api","version":"0.2.1","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run bundle && npm run minify","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","event-emitter":"^0.3.4","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","lodash":"^4.13.1","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"^8.0.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"}],"keywords":["alfresco"],"gitHead":"5773d68d1cbcbc0fa03f3d9c127beae6f101a1ee","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.2.1","_shasum":"687b2f1b7c8309b7f49f917fd29836b2b392be27","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"687b2f1b7c8309b7f49f917fd29836b2b392be27","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.2.1.tgz","integrity":"sha512-665zYNRB0tsSWVPZINtNHc5T6FdVcBM9wcnKRfLTUz6b8L8Dr3+PhNv9bLdgyMdvOSfBwQofhSBcg+lz3vpoKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF94eWusmVqO9VDORo5GVephSGWl5yxhfsuaqTabFz3OAiEAng2A0WSQQkrK/zBWhjDWCMsQjA5r9uX41dD8Zg1V2W0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.2.1.tgz_1468594493719_0.6773207928054035"},"directories":{}},"0.2.2":{"name":"alfresco-js-api","version":"0.2.2","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run bundle && npm run minify","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts","toc":"markdown-toc -i README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"markdown-toc":"^0.12.14","superagent":"1.7.1"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","event-emitter":"^0.3.4","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","lodash":"^4.13.1","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"^8.0.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"}],"keywords":["alfresco"],"gitHead":"e9b1ffee544345a7f2517d0d643a37872b156a1b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.2.2","_shasum":"5f97a24b0a9177432721b22db91e199c01a3c2e4","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.12.0","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"5f97a24b0a9177432721b22db91e199c01a3c2e4","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.2.2.tgz","integrity":"sha512-eTmcXrrrruY2gfZwCTZwNk1LEcGWR4TTmP/pt0ubK5Oww+3xXuNTOofyx3PVsIz9xWIKluYB4AH3DyyJi99UMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkEeIlOUPn2Fn/OUHOJLVz1rVHEn5iLxVgQPzkQvYkmAiAlQsZxXZOe7jcvP8VNCeI9hkOObObXoAeA/+ed8lvl0g=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.2.2.tgz_1469095419223_0.5295669625047594"},"directories":{}},"0.3.0":{"name":"alfresco-js-api","version":"0.3.0","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","event-emitter":"^0.3.4","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","lodash":"^4.13.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"^8.0.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"}],"keywords":["alfresco"],"gitHead":"f3cbe6887e63dc1287b8bf87e65c4e2e9c0d78ee","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.0","_shasum":"4418bb041a45b3682fcb338852b6131591247f52","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"4418bb041a45b3682fcb338852b6131591247f52","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.0.tgz","integrity":"sha512-hfAt6pdvCaECKKTq8KEOI2o00pBI9F18dVTPRbUcqGdv/tg5r3a+8aD/Dkw+iHEW5ucCdlqYDGDaYxIkEaZgWQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBdhvmNl1bxNKaklcvv1J14tNEwoj+7pNKJ+fwLPt5HAiAaKcUG3A/6MLVphtMhdetLvqRD+F6yjEWl5tY/nzVWQg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.0.tgz_1471967447789_0.6434603789821267"},"directories":{}},"0.3.1":{"name":"alfresco-js-api","version":"0.3.1","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","event-emitter":"^0.3.4","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","lodash":"^4.13.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"^8.0.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"8b8524b36eece6152c0bd25f6596129a4d35f895","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.1","_shasum":"db081a7eac52a0adaa31c98f8439fc1ebcdc0dc9","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"db081a7eac52a0adaa31c98f8439fc1ebcdc0dc9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.1.tgz","integrity":"sha512-/YjgTs46BVWN0oMF5TquWMvX3qlioxbKEsaCE3VWsUReE6GuVdyvMekXpvTclg1/+F8I/Otg++XJN1Cwdcz5Ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFWdxO8V5rwsRaSI36g15lbIUdQUIiVsTChLauTPO+E3AiEA+lAyB90gDKGw2emWgqwgzSXQ6Pkur3R/aItg1SKVmuA="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.1.tgz_1472809569225_0.14924524445086718"},"directories":{}},"0.3.2":{"name":"alfresco-js-api","version":"0.3.2","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"^8.0.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"95d3ba373326f3a3fd6d2c02469e9968f8c0f56d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.2","_shasum":"1dce17067bad316ea9f9e2ba4366e99d17c643c6","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"1dce17067bad316ea9f9e2ba4366e99d17c643c6","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.2.tgz","integrity":"sha512-HJ+fUebaf3JLJG0e/9SZhS1ToqWvtyXqw2kBWY+CRwpeQOcsEmVXf31CnXwnqyflDD02muCYjvdVelnw0ExvJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpbxnnWrgW6GuxF/+R5lr9aeGukDaOO02eD0ZQLEDX+AIgfWqKtmwxd5MUZDZWaWYaEtLIDWggo2FKhUDolz6/WDc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.2.tgz_1474452355141_0.40196710219606757"},"directories":{}},"0.3.3":{"name":"alfresco-js-api","version":"0.3.3","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"^8.0.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"11b7007ea8248c51390f5f5ec667ca68f803a582","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.3","_shasum":"d4844f15998f6c267216fd85aade410b19f3eb89","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"d4844f15998f6c267216fd85aade410b19f3eb89","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.3.tgz","integrity":"sha512-6KWWJlNGzcroJTjzl+LDB0U55BB8HRb1CfOqPcB7NiIT49ZnhxEJrB23k+xvRHLmW3aox/godNZ5oejUFSUejg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3k3FEJ2MyuvUMmdst69kqToDP6Nu23srlUN8kLdPwSAiAESvwnZ5MVim9ZzELcCmcDZ4Lbswh1a5GgM0m8+C9Zdg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.3.tgz_1474885653213_0.490499472245574"},"directories":{}},"0.3.4":{"name":"alfresco-js-api","version":"0.3.4","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"^8.0.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"1fe5ca39c37b797aa2337bfced62178f5e7d9cfb","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.4","_shasum":"45550e148ebb2547d662c75ac91afd248bf60cb2","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"45550e148ebb2547d662c75ac91afd248bf60cb2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.4.tgz","integrity":"sha512-TlYkrjAjdOD94rcfACaqJ/9AjK8xB33h2CVZAFTTe/Iwyqk8PZ0YQJiY28gPOKuZGZSN3g6tle2FLGe5x7c2Og==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC//orw3ntY1msqwFCP+FQJFLc3n0a8YhhJ/MIIHVCa8gIhALSyvzIIK2+PWWCAsj9Jxy9B7PbiXvgfwsBG6R054hHu"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.4.tgz_1474911114268_0.5667543944437057"},"directories":{}},"0.3.5":{"name":"alfresco-js-api","version":"0.3.5","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json bundle.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"^8.0.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"cb5c4724af2d0684376070c9f7383216da1663db","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.5","_shasum":"fed5d3d4c95a5f82c55a07e01aa3d3b8055a4bc9","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"fed5d3d4c95a5f82c55a07e01aa3d3b8055a4bc9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.5.tgz","integrity":"sha512-x7gNZsZ5hTx1ORC/eUdW4/SLuCEWDqnSVPkM2xMSYnlwFbsQRlL9o8M20XETxoK1+3tBZE7fZ4sP8qTe2HaN2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDyc60IoORK5tmgyIhV6ce+qM56A4nDoZLnrIS21ZF1OAiEA49hatlyBWLHtItTtyHfcvpbUkEk5946/dlIePJzQ1jo="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.5.tgz_1474921133932_0.5893680525477976"},"directories":{}},"0.3.6":{"name":"alfresco-js-api","version":"0.3.6","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"dist/alfresco-js-api.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json typescript/alfresco-js-api.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f8714dac8e7cf324e36ed6646088d67a708e0f01","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.6","_shasum":"9b4b80cda253f55f38e0699f8339c23632efe1fd","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"9b4b80cda253f55f38e0699f8339c23632efe1fd","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.6.tgz","integrity":"sha512-Y7edwL/YyTKX6vTTw0BYmabps/1rfy+T4d4q7rLiCGVBSH3vNQns0e0YilEGsqWyiA5dNjkqnTr7DMHwyAuRTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJGZFUf7J1sGLIIGrxS3nq/aAkA9tQMlF2UHn+AJffBgIhAIn1Nk5Z3W6IX1fIVbNy7dFbRC1kgg03Mf6oLDNBSe96"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.6.tgz_1477680844002_0.3513676719740033"},"directories":{}},"0.3.7":{"name":"alfresco-js-api","version":"0.3.7","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"c3f5b9781a429760e650167bd66d1e870e2daab2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.7","_shasum":"d4ee87580a78e285b143d5dd4f30de6521d712f9","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"d4ee87580a78e285b143d5dd4f30de6521d712f9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.7.tgz","integrity":"sha512-AlPWQbr/NU4gSH7e3r8nNad8EZi9DqbBAYnPrPavs8aQ40BliKGPQiHpMqZy7N74tVfIFsmmcIT/rvh9GE4ikA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqvq+FFxfBpH9F72gqszgA5giD4Sr109MYzS+xji9+pwIhAMwQYwHGWaVJoNyV6z70g17FyyU3jMaOM8kMIZxYR27t"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.7.tgz_1477832901591_0.37805679137818515"},"directories":{}},"0.3.8":{"name":"alfresco-js-api","version":"0.3.8","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"36a591672084beaa8f817d969277930e89d7041f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.3.8","_shasum":"24024a76654524cf62bed4a84653a8f6828d78aa","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"24024a76654524cf62bed4a84653a8f6828d78aa","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.3.8.tgz","integrity":"sha512-tywZGpibQ8yxueGkgP4DaNshsH6DDME6MYBfwQvd35L1OfDDcO5aflexeJr7mLMs+eqxhr8PONwHApqcCK7wsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFdFbzVdx9rOHGeWH/7++BQAWEAJCNKY7tRErJV4SQJAiBSlTGjUwN8U3km0kw4IeZdeahMA8YPhpLhoKd4wNnYig=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.3.8.tgz_1478272134035_0.3536839410662651"},"directories":{}},"0.4.0":{"name":"alfresco-js-api","version":"0.4.0","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"20f07b84700c77033da7e7ea752894fe3ccf7a8c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.4.0","_shasum":"7a3598c6427f3fcf110a2bd1ca71b799af183466","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"7a3598c6427f3fcf110a2bd1ca71b799af183466","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.4.0.tgz","integrity":"sha512-oNlyf4sJdtd6rlD+X0IpGPF78JWFTHM7kApfAmpWUTbrptjRoeqU7100YhX5LNqNdbe3ZnLcgwd0nuNcesXeEg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5WOFxhlCO1M2p43pXM3adEB809YaMN0Kl8p+3ZtFQdQIhAN69ucPPxVY4pRZW5t1q6+gO1GCmJ4kKfZHCia5cHtr8"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.4.0.tgz_1478902682709_0.08053355477750301"},"directories":{}},"0.5.0":{"name":"alfresco-js-api","version":"0.5.0","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"5e09d69f9d90435834db06082d6436616ae04cfc","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.5.0","_shasum":"5a83378fa2df940be7bc35291a9116dbb934fca5","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"5a83378fa2df940be7bc35291a9116dbb934fca5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.5.0.tgz","integrity":"sha512-oZX5eFYTp8s69tEapgqxQyZc5KHCIDVz88NyqFmmF5sAF9EOJQ5LNQ10utR/rEMWhEwzkwbJjTtWDFsQFxCbkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGM73FVy7y9/yf7TNqcwptt94dWIqQ2dYSGEe2NTaGcTAiAtOZUobd72dNnmMS2o0Ovq81/5Y5CuIKvntL030S9nNA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.5.0.tgz_1480100481949_0.18630524491891265"},"directories":{}},"0.5.1":{"name":"alfresco-js-api","version":"0.5.1","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"09f968e7a3427c5008ca595b80c12ed3c0904a15","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.5.1","_shasum":"348e644b2631484a72dc57cc416fb6038bf6aad9","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"348e644b2631484a72dc57cc416fb6038bf6aad9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.5.1.tgz","integrity":"sha512-OeTjj1OkMfFsfPvhtdXil3zEbzWJ4mYivBk8UEb00JfGycLJgiJ/flHrrmgWtu+Shq3r338lWD7Rip3eMvCVmQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHmcOwObX0XmXSx4Hz8VL0ak/SgrWraWSD2iqfYn1KGgIgFGtVzDI4IuuDmWFM29EyNjhKbgeYMjRvjzVEaccFPfg="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.5.1.tgz_1480939279687_0.9123793342150748"},"directories":{}},"0.5.2":{"name":"alfresco-js-api","version":"0.5.2","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"32230a8dc76ff510ce5390080387c995c5553810","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.5.2","_shasum":"3eaaa914fa64a9ac9e969bba6302669dff4ccff6","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"3eaaa914fa64a9ac9e969bba6302669dff4ccff6","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.5.2.tgz","integrity":"sha512-byps65obzON7WGwS0E2oGluVFOWuZ8rnrMFYm5RFrnHEG2PQKPM3PLxbYALkWHR+IoEA/xydd30ZkZmEMgECdQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1Ivao2QDR4rRmb4iIPdsYmDN+19MFuuhx3kzuRQyIOAiEAzaicK3VVdVBqNtkg47Gp6zsn9bZunCFofHG5Tx8xnkc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.5.2.tgz_1480943706171_0.23162035108543932"},"directories":{}},"0.5.3":{"name":"alfresco-js-api","version":"0.5.3","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"7a2d0a8a90a5537920d3ec132391a481c76c9b6c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.5.3","_shasum":"b1560e740abd107d6019ef40af7571c0930f963e","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"b1560e740abd107d6019ef40af7571c0930f963e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.5.3.tgz","integrity":"sha512-SQcm8fS4AlBxmZrFbAhuNoXHmbYRIHDZknwgpALV6tz+R+7tt7n5/c7Ive0qwAiFQLAMdDGWPUPASKGCWq9luA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjoHuWF2CGvyTL3kRNY0EZsqxHKKJOAArSpybj/6dCAAiBo5leeXYZBhx1mNoMp9DeMcPGCW0uzXEV1ayePbqbYcw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.5.3.tgz_1481025945420_0.19641764904372394"},"directories":{}},"0.5.4":{"name":"alfresco-js-api","version":"0.5.4","description":"JavaScript client library for the Alfresco REST API","main":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","minifyify":"^7.3.3","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0425c05417ec406c0a4af7b631d7bd16f241e45c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.5.4","_shasum":"a873e52b1eac864209c8abb2dbe1d83bbda6fbbf","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"a873e52b1eac864209c8abb2dbe1d83bbda6fbbf","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.5.4.tgz","integrity":"sha512-7VmNbwOiBSNHt2cFK7Ykre9HuIRTABaa0RAffDHygZWBppxFTwVNPo+lPahNk9v9p+lQombYzBjpNPYmg20qCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGgYzlGBPrLL+DLx8fyrJXzEPMA0PKwC4IGnIcTWOepnAiAIuXzkdKORFcl6jaEfS7yHzNSvwnjjqqm20my8Y1zISw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.5.4.tgz_1481050048086_0.7012649085372686"},"directories":{}},"0.5.5":{"name":"alfresco-js-api","version":"0.5.5","description":"JavaScript client library for the Alfresco REST API","main":"dist/alfresco-js-api.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015-loose] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","babel-plugin-transform-proto-to-assign":"^6.9.0","browserify":"^13.0.1","chai":"^3.5.0","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"b052beb308b4d96db01d4f918c0f75c4f74afdf4","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@0.5.5","_shasum":"6d4fd2c2bc624deb1daf1e0dff7c5db3ae7db812","_from":".","_npmVersion":"3.10.2","_nodeVersion":"6.2.2","_npmUser":{"name":"alfresco","email":"mario.romano@alfresco.com"},"dist":{"shasum":"6d4fd2c2bc624deb1daf1e0dff7c5db3ae7db812","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-0.5.5.tgz","integrity":"sha512-3lJl/09tyJAi8y2XcTZGCSKwy30dC6ndZelYWIBhwueEerTl92jsBI+eh1D30cgCEhHrKJdJxZBiCb06QcgUwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDszvuE8N/U9PE3brgLiPRpi/2Yt2pnSy9aKXNOcLaVDAiB6MArg2KleyKi44C8mq5MffBl2/V0rPcx9HSDUO1i4Ng=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-0.5.5.tgz_1481645874806_0.6727219298481941"},"directories":{}},"1.0.0":{"name":"alfresco-js-api","version":"1.0.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js package/webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015-loose] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","babel-plugin-transform-proto-to-assign":"^6.9.0","browserify":"^13.0.1","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"035e29a2603d1db8ba2532ae5fccf9c0276eedec","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.0.0","_shasum":"7de90e2046b5da052e9966d5c0b7786765476c82","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"7de90e2046b5da052e9966d5c0b7786765476c82","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.0.0.tgz","integrity":"sha512-G/RYjRCLIMevLjyB98I4aFUnrmo4CPQeGbnWpNTwBS9GQl8McgMSE4+7868R7oSEwiFwTyrBlRTvCPZahcHZQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICs1clRK5ZQMjA2gbBi+etKAOi5eIZIEQFh4JjRD9kMIAiAsQtXwbUDaA9eI4bf83EBhHWcTF3ngtMvX0qFD1n+ulg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-1.0.0.tgz_1482253843628_0.01074697612784803"},"directories":{}},"1.1.0":{"name":"alfresco-js-api","version":"1.1.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js package/webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015-loose] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","babel-plugin-transform-proto-to-assign":"^6.9.0","browserify":"^13.0.1","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"aab310184e552d9ee67d3cd893833a8806bb86fe","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.1.0","_shasum":"72ee2a5bb293dcc79df2fe4ea74080fdf4ed820a","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"72ee2a5bb293dcc79df2fe4ea74080fdf4ed820a","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.1.0.tgz","integrity":"sha512-tV31dT9UyCe1lFtlVWZIpIi46eyHOIgfYC17SPxW+ihMkGtvl2FRRRmoonDOCupZghvOH17dFdtZOdSVWZuDbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZCM3+hpgVqo7bJaNQPF2Y4kHFB+lt4De/wQuQXbQ1yAiAT99AVTUzqqnZpTw8dsP9QcJlj30So6171GM3xqQj+gQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-1.1.0.tgz_1485527341599_0.22565873083658516"},"directories":{}},"1.1.1":{"name":"alfresco-js-api","version":"1.1.1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js package/webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015-loose] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"1.7.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","babel-plugin-transform-proto-to-assign":"^6.9.0","browserify":"^13.0.1","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"95b754ba1106c51d2ee361465a2b746a1b8b17c7","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.1.1","_shasum":"95a8546378fcd1fbfef59d0bf6915b4f5d6a3436","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"95a8546378fcd1fbfef59d0bf6915b4f5d6a3436","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.1.1.tgz","integrity":"sha512-y8lr+ra4Px3aEa5OYnivgk+o+djQlXRrzMzmr2AHUaiJHa1Mgt7aBIJzV31neqSRoMGqpLqFVeO4JQec1QM09A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICNTwYPJecY0DylelnQ+ORBCju1naesW2t9iNjTOrPPTAiEA3AsPwdQt2mDbtfGDFMq/cxSShE0j8nc8lksX0AOM8OU="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-1.1.1.tgz_1485535705045_0.17138019856065512"},"directories":{}},"1.2.0":{"name":"alfresco-js-api","version":"1.2.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js package/webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015-loose] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","babel-plugin-transform-proto-to-assign":"^6.9.0","browserify":"^13.0.1","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"808602ce5aaf499d7ad9dc7e4f56028cd6a1c123","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.2.0","_shasum":"9f0aa6d3d7e08fff754751b93c355dc8ab73871c","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"9f0aa6d3d7e08fff754751b93c355dc8ab73871c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.2.0.tgz","integrity":"sha512-tOnz4tXUYVype9rl/xkLpStuxBysTyUNr+IdhcN9XQw8eR8PDGbQKbMs6PDWChqxvoW4IGgW7NLG1LGeCqJPAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcSgD7cZgdiVN+gCCgordLpWW1+0PvBPAY1t4g2KPPMAiEAuGoWcM98IaAWlWQTn+WSDpgzrmnD6QhuY3Xd+8jg4R4="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-1.2.0.tgz_1488210099042_0.42836776142939925"},"directories":{}},"1.2.1":{"name":"alfresco-js-api","version":"1.2.1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"browser":"dist/alfresco-js-api.js","main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js package/webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015-loose] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","babel-plugin-transform-proto-to-assign":"^6.9.0","browserify":"^13.0.1","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"3d1298a72ff2c3cdd5f7acd1ed1ec682f666c3a8","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.2.1","_shasum":"ada3518b2b5411ff98bf2fe11a8b4ac216499bf6","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"ada3518b2b5411ff98bf2fe11a8b4ac216499bf6","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.2.1.tgz","integrity":"sha512-bXFpLLVnBKdE7hwjd6JjmeyhwdGSHdKMY5U/3xeVpStEocmTc+YzymVRK8sKh+7Kn+NDHcZ1TA94kW//zTmRCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVHtgzGVmmwS42lnOpQhfQjySwQIyIwybEOTGKKAULBAiAj2fqfuN/hK/vtp71GqDYAcN1o+XRKywmoiCI1KO+tqw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-1.2.1.tgz_1488814994658_0.5670811161398888"},"directories":{}},"1.2.2":{"name":"alfresco-js-api","version":"1.2.2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf dist/bundle.js node_modules","build":"grunt && npm run tslint && npm run test && npm run bundle && npm run minify && npm run toc && npm run webpack-test","webpack-test":"webpack main.js package/webpack-bundle-test.js","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","bundle":"browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015-loose] ","minify":"browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1","nock":"8.1.0"},"devDependencies":{"babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","babel-plugin-transform-proto-to-assign":"^6.9.0","browserify":"^13.0.1","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"09547e29cf357c6de9df92472942d77b0f4f1311","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.2.2","_shasum":"2b30703dd3c693942e8ee5a05b746376509c74ed","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"2b30703dd3c693942e8ee5a05b746376509c74ed","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.2.2.tgz","integrity":"sha512-vMrpf6E8Yb8i5uoneVZQLsVi386e9RFmcE6Ts11iPB7KQDU9WHECyw1h5Qs4XmyMXbvHnA0mYIH26GKsD2+OSw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGTSohumtoadc+CRQ6ZMeNshJlRhuJ+fZtUhlEMA/H7GAiAm0LdR3dOiqn2YawJFMBFn+Dqfsnpp+e6CzDNagyy+VA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-1.2.2.tgz_1488823176413_0.5301373084075749"},"directories":{}},"1.3.0":{"name":"alfresco-js-api","version":"1.3.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1"},"devDependencies":{"babel-loader":"^6.4.1","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"ccd1e98e1bc85cafbf728992e4b1bb554ea6fb7b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.3.0","_shasum":"cc16f13237afde9b5e82538918ede23697129e02","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"cc16f13237afde9b5e82538918ede23697129e02","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.3.0.tgz","integrity":"sha512-u44aiw6c0N2zwwucPfZQLkXtWFlyZFe6x30dvbihxB0XadKHg5lCxmwtcWx7IM/xVHZvEyZ/vnWUZ9zy0XR6vA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBUPHou5upQIXyRNTD9yP29fa/UoTVEOvpZnEAIcvPtQIhAK0A9H8rid7iLLWoBAKn+Jccia3qYxYYmQpnPXCNzBji"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/alfresco-js-api-1.3.0.tgz_1491306069733_0.032480454072356224"},"directories":{}},"1.4.0":{"name":"alfresco-js-api","version":"1.4.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1"},"devDependencies":{"babel-loader":"^6.4.1","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"3e8683bbd6d9ea6d0bf9d991a86fffe0dae652a5","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.4.0","_shasum":"a8916144021b61eeb72d68c1be0a64ad4f11bba9","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"a8916144021b61eeb72d68c1be0a64ad4f11bba9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.4.0.tgz","integrity":"sha512-fbGcBmFfLT0Ip1p7kEDxq2+EDH8ifI1zPuCosEyti4GN8toBZ7d+kJ/T3yt0VRqZV4X9cs6Xh2fTSTV54kiNiA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuDfxe2XsYOEopsg7DXxxRLQiMFxlnaxtZXwJrq/11ewIgI7pkpBZpOCsJnuecbCbm+bc7eKzUHCW1m6P6oli0UF0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/alfresco-js-api-1.4.0.tgz_1493302934132_0.12122585764154792"},"directories":{}},"1.5.0":{"name":"alfresco-js-api","version":"1.5.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1"},"devDependencies":{"babel-loader":"^6.4.1","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"4aa08769d81a93dc3597d43c766862a9f11966bd","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.5.0","_shasum":"24e895205ce57ec7258159f5865b46ed778870e5","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"24e895205ce57ec7258159f5865b46ed778870e5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.5.0.tgz","integrity":"sha512-HRoJIb7daQ14/ZM/D+WmFB/9i+z3J5AiwX+Quz/yGfHhKG99RU8KwPdaWyPfJWo1tI9WqkvPdXoeBBd3A5wJKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtpeP6E2ZJZhz5j+UIkp1cHTNV6SPFaA+SULWcUkuSbAIgCAW0SFgwaZzESUm7acA8xq4tz6QcCQ/xzb6rb2ayhsY="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.5.0.tgz_1495740918096_0.6299802549183369"},"directories":{}},"1.6.0-beta1":{"name":"alfresco-js-api","version":"1.6.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1"},"devDependencies":{"babel-loader":"^6.4.1","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2f71298be74952cfd2e84675884a386618fbc520","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta1","_shasum":"b8a165f286f42ec4511c0ccf5b5f3df0528f1691","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"b8a165f286f42ec4511c0ccf5b5f3df0528f1691","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta1.tgz","integrity":"sha512-rZIpbnOaTNWuconKCaVPEduE8YDqNrTZCt3o8mxEyz1t8Y5nss/e+m/6TF0Qqaby0nGy64hNdCvnkVNnjGjPkA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4XMMTMsu+6vABlb+I9NZfwHEq47XOMynWxUnrDDvp/AiBvXsZUEjeYak6T7e5SwCu86Po6CgSWzKemQUs0AGVcKw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta1.tgz_1496402217266_0.7205910666380078"},"directories":{}},"1.6.0-beta2":{"name":"alfresco-js-api","version":"1.6.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1"},"devDependencies":{"babel-loader":"^6.4.1","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2f71298be74952cfd2e84675884a386618fbc520","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta2","_shasum":"999b3132a08a1b91db4c341719d823c83b0e2bf8","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"999b3132a08a1b91db4c341719d823c83b0e2bf8","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta2.tgz","integrity":"sha512-qTvITfVX/GVJr5/5FcbRqlwRYPM5Up9RwvPogehSk74vUUpZ3m6mxqpGAPcwUCpL3461D4IJTToBvThp34FE4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJE10fL3Xl4Ol/SYYqs4kp/6l61TkaoeBjJK+DKipeiAiBDSgWHWTJ0EPyKSL9WaM1g1CHOlB0qoYYghb3dXME+Vg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta2.tgz_1496671386642_0.644518862478435"},"directories":{}},"1.6.0-beta3":{"name":"alfresco-js-api","version":"1.6.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1"},"devDependencies":{"babel-loader":"^6.4.1","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2f71298be74952cfd2e84675884a386618fbc520","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta3","_shasum":"c357ae8cf481e4505ce52218b62ca71bbc4c65cc","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"c357ae8cf481e4505ce52218b62ca71bbc4c65cc","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta3.tgz","integrity":"sha512-dW4l/Nk7wzQdy599OOCMfbF62AUoTy5BemoY7pIp6+e+Ps1icS5AJvjvsTRXQz8HrWSU8zEISRRPnEF46CXcIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAFsjDAP9uvOVunkKB6591Rqz9HsShbxDWk4LvCx7FtRAiAbiUrOZpj5ltrpaHwEwiMNjFASy4QjISNV2NxzMhGETw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta3.tgz_1496676252774_0.12599551607854664"},"directories":{}},"1.6.0-beta4":{"name":"alfresco-js-api","version":"1.6.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1"},"devDependencies":{"babel-loader":"^6.4.1","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2f71298be74952cfd2e84675884a386618fbc520","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta4","_shasum":"486dc4299316565d1895e1f17c95408d4dfb89bd","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"486dc4299316565d1895e1f17c95408d4dfb89bd","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta4.tgz","integrity":"sha512-a0/Fr89AevQtxr4BSaOZAjV3Pzfn1yx8x8TG7ekUxPhc9WC1EJuhdHRuKO3RADmnqyu7l0we8KKIn6Z7ArWaFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChe1YYGOn6S52eFWzpXPtFnXD3s0lNAduLbjZcyrHBqAIhAJBCozjDC/Y/Doblc42qAWDY2hqjTWijRTRmqRv0plxN"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta4.tgz_1496682650804_0.15848562051542103"},"directories":{}},"1.6.0-beta5":{"name":"alfresco-js-api","version":"1.6.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint -c tslint.json index.d.ts","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"^0.3.4","lodash":"^4.13.1"},"devDependencies":{"babel-loader":"^6.4.1","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.18.0","babel-preset-es2015-loose":"^8.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","minifyify":"^7.3.3","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"^3.8.1","typescript":"^1.8.10","watchify":"^3.7.0","webpack":"^1.13.0"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2f71298be74952cfd2e84675884a386618fbc520","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta5","_shasum":"8d71b02812fdaf0fc0c05778f278dfa94e1471af","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"8d71b02812fdaf0fc0c05778f278dfa94e1471af","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta5.tgz","integrity":"sha512-zHOfCo8zmi7w1zgLHwc3M0g+K7/U6rDvi44uSM83eCS9ilpB/WkTSujLYeMECkKVJfB4IIHzxnu6SLTtSK1Lig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNMCwRiJO+MqWBIrCeHSvpSjK2FI2sBK/m+uxYWWnYmAIgJDr02XrOdqYUC1nR06NUoqfv6GUn4XrbuYH20qd2Cgg="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta5.tgz_1497276190691_0.9809907064773142"},"directories":{}},"1.6.0-beta6":{"name":"alfresco-js-api","version":"1.6.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"c420350c19379efa556a793e141a3cf73105c34f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta6","_shasum":"9c8d0bb4e7f08c2cf6878a8dab84ba59ae6c1742","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"9c8d0bb4e7f08c2cf6878a8dab84ba59ae6c1742","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta6.tgz","integrity":"sha512-VwzJBgb5K6HgocP93nJO1VTdJjiMwSVCFlZA+xGH+3WYtVhBzuZpl48Y+me9dX5FZfplUl/0CwCXpNKnLQoCqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElCH13uczj7Cwe7SKlqGCGjvtvjqAO+lqX6ug4tVXIOAiBuQOOA0iSMAyw3y2c2syxYBAOzwCw3UNMxZqJSTh+rkw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta6.tgz_1497880977919_0.1689632493071258"},"directories":{}},"1.6.0-beta7":{"name":"alfresco-js-api","version":"1.6.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"92a375081b748b575112dcf870985d09983382fc","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta7","_shasum":"5101fd5b481b2e6b7802900e930d053b69d2e448","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"5101fd5b481b2e6b7802900e930d053b69d2e448","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta7.tgz","integrity":"sha512-8Qf3NrYATfvqabAhq9z7A6qvkIKFmcffcHPCCqhCEp5RahxA2WfO317Tg5h9Dp/vy0Dxs/v0sHn+UYJp+jt+7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9EC10lLwR+ezeAaoviiFXuGS1jAeL5d32E0As1poCWgIhAKsEgGSyPX/UuWK/cCYCp+TAfvIhDDwsrj0E+o4qI64b"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta7.tgz_1498208990404_0.08303147903643548"},"directories":{}},"1.6.0-beta8":{"name":"alfresco-js-api","version":"1.6.0-beta8","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"64082673fce3dbf8f092266be58f5da8baacd683","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta8","_shasum":"1d48c7fc5d5d6ae5608d3674451c1588c4570c3a","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"1d48c7fc5d5d6ae5608d3674451c1588c4570c3a","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta8.tgz","integrity":"sha512-H3gylv1FGx13VlQyhYZScdfYF9jfIPZKCTUFs6K8oAaK1swFRJ6kPntQwzJ/aZ6zMJ63OrtDp6cmZi3uHJNuOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBD+iezCxT7R/uKDSYUgbXPvzdWhoLd9ypn/ICDiMvAAiBwA756jE7EGHRNj+GOCAV3W23nf8bH5VoaFhyiQ9B6Mw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta8.tgz_1498221981996_0.15826285490766168"},"directories":{}},"1.6.0-beta9":{"name":"alfresco-js-api","version":"1.6.0-beta9","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"64082673fce3dbf8f092266be58f5da8baacd683","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta9","_shasum":"a8a296aad8313bd790e9a2a4b90c57ae6ab32f60","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"a8a296aad8313bd790e9a2a4b90c57ae6ab32f60","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta9.tgz","integrity":"sha512-JvbBY8WnmtC8w1Qk/z+alXjXD3GkU5+UhZllSI3IklDnKzGT/bppSCejXrg8YzMGl1Kt/jBN6BSiYeLg0IsLKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICYElR0m5qYhrRkDO1IwgsJ7FNbMwdfJc+S5kr7PV54MAiAK5SyKfEDeppRjEmnhQLp9BHfCeP651D8/Ro0CAhb0IQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta9.tgz_1498475506505_0.518408048665151"},"directories":{}},"1.6.0-beta10":{"name":"alfresco-js-api","version":"1.6.0-beta10","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"64082673fce3dbf8f092266be58f5da8baacd683","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta10","_shasum":"58d5707acfa8fb6927b93b8f811c70eef087e5ed","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"58d5707acfa8fb6927b93b8f811c70eef087e5ed","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta10.tgz","integrity":"sha512-0loEC2UYDnXL/LJagQFQ48Sm/uBjm1xFmtluaKe0ObKyXLOCMNPmWNDDUaXbLgVdTHXKdDQp6RQ8PGjN9636LA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGbIG5wkMiuWSxvrRf9UJ/E0LQ0qU5ZxQ0uPBXGWK6qAiEA51zapv51IF+cf1G6BZTBvWiuqA+xEKOQa3jLic57TW0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta10.tgz_1498480549420_0.6270488314330578"},"directories":{}},"1.6.0-beta11":{"name":"alfresco-js-api","version":"1.6.0-beta11","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"64082673fce3dbf8f092266be58f5da8baacd683","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta11","_shasum":"8df62117bc42391aecccb82f03472ca417cf901a","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"shasum":"8df62117bc42391aecccb82f03472ca417cf901a","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta11.tgz","integrity":"sha512-CUHxpEFDtGCtEZAGvVyT8A4tkZTiSZPfAhwPbTqzMRjujxP+kmG9uNlIe9o29D4t1JawYECz7xCql3JtR1/ooA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDEr9QpDNaHjfZUjrKSSyndn/tClcVgg6j40n8puiLolAiEAuvbXtrMlrnROfNvvr1o/UVLdMMA83QKi1vRxlz8GvkA="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta11.tgz_1498484056381_0.32237222138792276"},"directories":{}},"1.6.0-beta12":{"name":"alfresco-js-api","version":"1.6.0-beta12","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"64082673fce3dbf8f092266be58f5da8baacd683","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta12","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-QILAslVIB2nPzZLu1vM0GozmP4G7kdm+VhCaIdNtEjDRQQg2LhTXGZz9EiypAL/UFAYTih5+2EI7/7ux1SRQPg==","shasum":"8f3a0326b1a74abb3015b68fa7100fc2de5d8fd5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta12.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPVcaELNWUw9WXYvv3n85JeABWRow6YO7du16HFDGbzAiEAo9FzXrSFjeT1Ua6bzxQBYrujlt7zz9fEVPrxvOVk4gM="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta12.tgz_1498485987188_0.6790760760195553"},"directories":{}},"1.6.0-beta13":{"name":"alfresco-js-api","version":"1.6.0-beta13","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"64082673fce3dbf8f092266be58f5da8baacd683","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta13","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-uvE/vR7En5H7xTUMtj2qOjqgg1/sW7ksKqLPjkR972lWKzNObDkG0Dfe/G3PveDNrGIwHNmYvfWWeiHBx7mcdQ==","shasum":"ac758d24a3a5f9ad7811e123f1da96c83eec4d3c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta13.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXn6SPco/oo2vLhHUN4RFt2GER771Wv9EGVVEN5tC9jQIgNDrlEQXCvz3CgTzwZGts+69vJx6JIb5OrYEhnjfRXuA="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta13.tgz_1498487613456_0.7516691407654434"},"directories":{}},"1.6.0-beta14":{"name":"alfresco-js-api","version":"1.6.0-beta14","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"091e1a0ce1de02c792659bd291ccb8796e1ef538","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta14","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-gZt6WwJ0i9sjKMD3aHiEuN8KE/HiNJSvLaSaDjid8TZggP4MT0unxpeJERN458Aiy8RZr+Uk/mna550qQ0kINw==","shasum":"b68ebdf82ebb3a5b5d860e2984d19b7c2c285354","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta14.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsu86z8BvE+L7lkrCAq7dOGfwCqvtkw4DFgGzJpqADGwIgIGnE2Bz74AraB/hon+DrmgW4P3DW9Z1HzPl5FfLaJFE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta14.tgz_1498667932130_0.3310732408426702"},"directories":{}},"1.6.0-beta15":{"name":"alfresco-js-api","version":"1.6.0-beta15","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"091e1a0ce1de02c792659bd291ccb8796e1ef538","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta15","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-vN2q5yOX9/FnBrrQvrut/6dl/fCNnmoQzICL9eIye5KRyQZDqa++S19nJR9hsDm3L/koinS0CBeRIjVkL2GzvA==","shasum":"6f13ac3ba47bf9b85e802ad0ad5d3265313afb43","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta15.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKdK/Q/CI4661dypWO4L59R6OYn572M2Ki58wX8vwjkwIgdec1flVnRDucFp83MVM7N/FjWO/bOtvRVEhxE1RX+gI="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta15.tgz_1498729111013_0.02630524872802198"},"directories":{}},"1.6.0-beta16":{"name":"alfresco-js-api","version":"1.6.0-beta16","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"6eebfdfa228fb0220a27642c125c33bd9535184d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0-beta16","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-caaJ9OcfByKXmY66M3AMvU2llrkLK2yg21eVsBqkt/DoEL1BnLQdv/Ng18VB4VWiIGxLaelEJHbtpknY6TAHJA==","shasum":"9351e498be3fc58351958f88e883e11fd6ccbff7","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0-beta16.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/cmVJTMfc0LiZV/E2t1Gh4kvO2G/1Z04ZwcBSWPe54AIhALbfPNk8nEKO9u+axWevMQn02JhgeU8cNzMANBgf4ccw"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0-beta16.tgz_1498748505295_0.9535034252330661"},"directories":{}},"1.6.0":{"name":"alfresco-js-api","version":"1.6.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"6eebfdfa228fb0220a27642c125c33bd9535184d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-DwbXyJbg0V5ktY7NDz2kx2BJrKhekOqnmGCH8qfVZPu+pqaI9hVRKskHNVYPyVBmsnNUcsCuSviMnw7gfiACxw==","shasum":"302cafcdf121f3ea6544373bddaf911e1cfd0f85","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIASRHDk/wJkRV7vnZCDCiQhcd0QJp5iiby/KtszXVcLaAiBtkObH0UP0kI4/t6woG7GlIUURbxDAEOFnBemuVVcbLw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.0.tgz_1498749099056_0.665297009749338"},"directories":{}},"1.6.1":{"name":"alfresco-js-api","version":"1.6.1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"928edd436d0f2da2f0c3a5eb6ab55a6e72d767b8","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.6.1","_npmVersion":"5.0.4","_nodeVersion":"8.0.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-rKSJr1SKcUi1ZcrOSAAP4IYP9TmT/f1y3GYXdfOQ6nesFwJK/ffAHiaTgGhyQb8CjdxbsBPLzWiy2LLgFu/W0g==","shasum":"bebf992dc8c8bedbeaede16b3a340e587c114b20","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.6.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICldjdFa1JLPWObtPCaWuiSMrCDzOD3pFc3adMCP1JlrAiAdPtMfb/120YkQ3EpSSoKMJ9r10hlb0jD676oW/XxNzA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.6.1.tgz_1498770236710_0.7994670113548636"},"directories":{}},"1.7.0-beta16":{"name":"alfresco-js-api","version":"1.7.0-beta16","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"024caa5f5d0b7e38d03fa5f0b02b7a419b435fbb","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-beta16","_npmVersion":"5.0.3","_nodeVersion":"8.1.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-B7rJejCBO/yXsoV9c+jKaUt0wnZ39MbxoBZ/K4ZXKx/KuGEx/JWySJmR81Z2aWIcn4FDVTYIcTZtOZQbjVMdDA==","shasum":"29f34849c15cc196b3ed09c244f9f058f3ef533b","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-beta16.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFeJbrtvfLdNnrJIY6sNDlrEJ5S0Bk1XKrAdPWO451xLAiEAgTURVu5C8HcaMQH8kblubEVLOzeJN7eOlrXO3WGqXkI="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-beta16.tgz_1499090994428_0.8053047666326165"},"directories":{}},"1.7.0-beta17":{"name":"alfresco-js-api","version":"1.7.0-beta17","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0ab757dcad3cff2209c86e751c1ec375d6ebb07a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-beta17","_npmVersion":"5.0.3","_nodeVersion":"8.1.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-WGRXJW2BsmbUhg11WSmODtoEK5+I4gcwJas1loe0ZqVXOD3Qpu0ZqYtgYjYr/217IenidbVh8B1jDLF86q7sAg==","shasum":"670e2c773a2092eb90e7b1e613ccacdabe7ad83b","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-beta17.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICVNJEZ3e8ZT48Srjs+xM+YP4PYDZGBVgYYcbdNYAHbCAiEAoD22Nlmy1snI/CYSJzXjgYr0YOfE83yhP9gklcMDN5M="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-beta17.tgz_1499695806603_0.06671262136660516"},"directories":{}},"1.7.0-beta18":{"name":"alfresco-js-api","version":"1.7.0-beta18","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0ab757dcad3cff2209c86e751c1ec375d6ebb07a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-beta18","_npmVersion":"5.0.3","_nodeVersion":"8.1.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-lohNvCcmUFYPafD4GpBc0bX3jsuTb+ltHxvK+KJ7g/GeGDvVcsloyL2LGHgHBqmUsVjpP3xBTGrKdkPK9FW2XA==","shasum":"fe054d3f4551b261ac1560f746ca6b29897c2593","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-beta18.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+s+rsJXmHrm0uX5WpZ1as8d5xckYnzxJW29R5RcXzcAiA0S5Ml+wb4wfqUI29ugAcRJJ3ZGPfLe5Lgjorv2HyziA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-beta18.tgz_1500040950544_0.5401095927227288"},"directories":{}},"1.7.0-alpha241ae97c4263709fdff019e198dad4c863162b3f":{"name":"alfresco-js-api","version":"1.7.0-alpha241ae97c4263709fdff019e198dad4c863162b3f","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"241ae97c4263709fdff019e198dad4c863162b3f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-alpha241ae97c4263709fdff019e198dad4c863162b3f","_npmVersion":"5.0.3","_nodeVersion":"8.1.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-F5pMKt+AFRceeAQ6BA1Up0KVd2Hx8uGa+lyApBVz5neDoiDWQ1gcCnN0j5HfvdtB6rRhTN1L8iPrecuNm+7Ljw==","shasum":"ecd05be373498831bbabbc1630fa02b7af34722f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-alpha241ae97c4263709fdff019e198dad4c863162b3f.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ1mB8H9n8cESaOj4CkIdkxWZ2udkU2ukYihXv8qDDQQIhAIAIotVKzRJ0qBH3j6g/+m2eYp4TicspugO3UIqU36BE"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-alpha241ae97c4263709fdff019e198dad4c863162b3f.tgz_1500548709045_0.7577457276638597"},"directories":{}},"1.7.0-241ae97c4263709fdff019e198dad4c863162b3f":{"name":"alfresco-js-api","version":"1.7.0-241ae97c4263709fdff019e198dad4c863162b3f","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"241ae97c4263709fdff019e198dad4c863162b3f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-241ae97c4263709fdff019e198dad4c863162b3f","_npmVersion":"5.0.3","_nodeVersion":"8.1.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-2tKf9WQWnXozyh863HPRQv+qprNy1F4J5gcMT/cWi20qNMTDvG+CP52B5iGp2KBp+Myk2iC3pC8CY/LiKuWzCg==","shasum":"b996836546ba177635e6401b3a00f36ed3cd6b2e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-241ae97c4263709fdff019e198dad4c863162b3f.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+St2JWnLciG2Vj0gCnlI3L+h9xOoKXLJHOYghAL7qpwIhALi2YRDQueUX/QxwjGZuzcN65LlBa0bwY7+w4A2IGnhB"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-241ae97c4263709fdff019e198dad4c863162b3f.tgz_1500549622952_0.3971063692588359"},"directories":{}},"1.7.0-beta19":{"name":"alfresco-js-api","version":"1.7.0-beta19","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"241ae97c4263709fdff019e198dad4c863162b3f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-beta19","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-LpCOusBI9e+r4yI7d6hhBS05lLSDOdQWgyzFLGrGm8bu7VQoQivMrwzEZKtXq84beIHqocdLfKLKByV5SiRRUg==","shasum":"aa633f0009bcca09ce5a1fce3ca2d5009458e049","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-beta19.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCszaJZN9qwv+x/sLfG9c0X5xvA0mXZel35tIPieTEujwIhAIYpYyU+wdI6gI0cdoGyftgKzNiZ57Y6PxWGnewnySxl"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-beta19.tgz_1500645690690_0.45440227002836764"},"directories":{}},"1.7.0-d44f0e3374d6ed0bd35503cdb347504b00afc21c":{"name":"alfresco-js-api","version":"1.7.0-d44f0e3374d6ed0bd35503cdb347504b00afc21c","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"d44f0e3374d6ed0bd35503cdb347504b00afc21c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-d44f0e3374d6ed0bd35503cdb347504b00afc21c","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-CWyhD5bNSOVoZsKLKBD1DvcGbq228eLEbmBa6oDC1TSxFt1zPVdjDikiKkoywSzjlMIYe18V23iZI+U/jlwrCQ==","shasum":"8931847ff8ff4022d2c4f9faaa726d494d2f1930","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-d44f0e3374d6ed0bd35503cdb347504b00afc21c.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpWKPZ3UA23b47BnSOjdxOT4v0SzS3i+6HrV/HdGqv7AiEA8vCzWyWCLucrQCq9WVuaUa42XqsnAtwCiJ1+JaGe21U="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-d44f0e3374d6ed0bd35503cdb347504b00afc21c.tgz_1500973135018_0.985143773490563"},"directories":{}},"1.7.0-f56c9e700fd4b855ac1fbc535bbddbdb51f42629":{"name":"alfresco-js-api","version":"1.7.0-f56c9e700fd4b855ac1fbc535bbddbdb51f42629","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f56c9e700fd4b855ac1fbc535bbddbdb51f42629","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-f56c9e700fd4b855ac1fbc535bbddbdb51f42629","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-N5Qv/r+u0sCrE5Ipi2nOfnvygIhBzYzUvykWoz44qSDFQXFQ+damHtslcZ99WGgVCBke7GRtmuMQi972rWa/uw==","shasum":"075eaae3d8c01f5e845f1d110a4c48f264f5874e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-f56c9e700fd4b855ac1fbc535bbddbdb51f42629.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHue4aa1p6WeJVp5G98EXjAq1X/FoL3DbCAwRgMblR5cAiEAv0Ehg8q3yO8hWqtypMBsO5LNX/2suvqNou6ZC/ON+P4="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-f56c9e700fd4b855ac1fbc535bbddbdb51f42629.tgz_1501088644232_0.2976988104637712"},"directories":{}},"1.7.0-e06a9f7144b53361383a907b88c20aeb3639d1dd":{"name":"alfresco-js-api","version":"1.7.0-e06a9f7144b53361383a907b88c20aeb3639d1dd","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"e06a9f7144b53361383a907b88c20aeb3639d1dd","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-e06a9f7144b53361383a907b88c20aeb3639d1dd","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-phlY9JPfPCxZDuqbgejyU0+uNr1CakcwdXCjRVxxj7LtJKDW8f1tghoQXwIv5NkREy/R40gWyDG5D4dIsuI1eQ==","shasum":"52812951f3fd5cbcdabcdab76c1832e5fd4846f7","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-e06a9f7144b53361383a907b88c20aeb3639d1dd.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD++QYuvNqFyhRmGSXh9Rra6jVtvJxOverUNWKd9Gg1hAIhAITykiKVhZXlIe2aSmgnqGrybSO0eua6wS3SadmzU580"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-e06a9f7144b53361383a907b88c20aeb3639d1dd.tgz_1501090497624_0.8176724065560848"},"directories":{}},"1.7.0-beta20":{"name":"alfresco-js-api","version":"1.7.0-beta20","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"e06a9f7144b53361383a907b88c20aeb3639d1dd","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-beta20","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-uB+z+6P7wv5rEc2A/IyyYYaoUsiEGa41Y0nB1fMNaGkPexpV+VTNloyIwykk5v51D93rA+pQ//MaLhjx5PwxmA==","shasum":"98a48488ee40d03c8daa00029549e915f345bfcf","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-beta20.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrUbJHNwdBXEVsTA2r9+o4UzOCrKVcynr0Ck95df0CAAIhAKfUDOx67zhe3eA5DG1HFU6SeH+l1wGWqYfPPc+8rN0t"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-beta20.tgz_1501250525932_0.9534457956906408"},"directories":{}},"1.7.0-56f5f0ba9cdf9e50ca571c374c3a6911ec70d6ba":{"name":"alfresco-js-api","version":"1.7.0-56f5f0ba9cdf9e50ca571c374c3a6911ec70d6ba","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"56f5f0ba9cdf9e50ca571c374c3a6911ec70d6ba","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-56f5f0ba9cdf9e50ca571c374c3a6911ec70d6ba","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-o1Tg62Cpz6METJjyMT5SF0uoFooCFZlhiKz8M47h7ajeqW3g/Bzj0t/BBu8Y7YHCFMb4MMnx9Tt2Ky3t2O92BA==","shasum":"36bdd3dbddc6e7c2dc3f3c06af96394567a5fe6d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-56f5f0ba9cdf9e50ca571c374c3a6911ec70d6ba.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFWIbnd6fChz7n3OGH/eYaoKda73dV2/VZ5TgIv4rM8mAiB1BDTBfcVoZhcUg70vVUJ4NWTDvPSe775FXN9B933vvA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-56f5f0ba9cdf9e50ca571c374c3a6911ec70d6ba.tgz_1501530182122_0.37297217082232237"},"directories":{}},"1.7.0-4a327805c923d8453bdabd61622c86d37864cf1f":{"name":"alfresco-js-api","version":"1.7.0-4a327805c923d8453bdabd61622c86d37864cf1f","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"4a327805c923d8453bdabd61622c86d37864cf1f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0-4a327805c923d8453bdabd61622c86d37864cf1f","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-sqy77MMKp1USlbrm7Tw+txiMi+XPmIEJmCn8Y9oF1ZLgkB6DOzrTTVRvrTWlj1MA0FC2tnkJtiSWCkGxv6CDJA==","shasum":"a20dc9f6b042f78725a87f2a0e6cbfc9a195e706","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0-4a327805c923d8453bdabd61622c86d37864cf1f.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClpanxLG5A6ljU1u7l+i2d5XJXblAZUnSww/lrDqQ9FQIhANLr9eMIUSDcDBIGGVoP2Z/XHJdXbVfbziZfQv1zrhJ6"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0-4a327805c923d8453bdabd61622c86d37864cf1f.tgz_1501530531034_0.28174315579235554"},"directories":{}},"1.7.0":{"name":"alfresco-js-api","version":"1.7.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f5ee1385fa5614d90cb429cbd9958a41f09e5e4a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.7.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-CyN1W1QxlKkE9X/WQv68pZr7nzPcR6LoV/hjgOCBz6QEkj8eBowzYB2PF3EL8d6g80LmgXBF733Dv0ur/kJqLQ==","shasum":"fb1028264f95f9ff8d25b6b4549439bc75829ef4","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.7.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBj8m7OIavN9jx7LHThuQB8AzhD6UeBqIyGeGvh0wIJ4AiEA5Osq0Uan6uWqqjgD1prV96NiRhd0zcfpvbwijGzsfXk="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.7.0.tgz_1501577773901_0.17399140703491867"},"directories":{}},"1.8.0-11d5599014613ba112c5ae080b4da6824857eed0":{"name":"alfresco-js-api","version":"1.8.0-11d5599014613ba112c5ae080b4da6824857eed0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"11d5599014613ba112c5ae080b4da6824857eed0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-11d5599014613ba112c5ae080b4da6824857eed0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Qai6F7PZZ5F8L01eRI5/tttOpVtfmXymgMTpg7Eb42F9QbvbnLnrC5JNkj4jHfOOQ9rZxFhNyYFEcwWUPPPyHw==","shasum":"03a4ebc6701df995a2cf1afb2a27d24c10e6535b","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-11d5599014613ba112c5ae080b4da6824857eed0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvS81EDj2OQmIni0deDhVQ0QvHvYclKfwvPsQhroufzAiBLc6BFBvsFdmdu2dkc4K0U7Fl5SK6TtpcT57qAMmljDw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-11d5599014613ba112c5ae080b4da6824857eed0.tgz_1501753927385_0.992969470564276"},"directories":{}},"1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4":{"name":"alfresco-js-api","version":"1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"c422a3b69b1b96f72abc61ab370eff53590f8ee4","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-5e/tiZcKzf31lUSHBuPJv6qCyLZQ2zRWbRHqIWawAx3p5d3L/f4cI9kgeU1ePGTZukqNk2J4qWy9r1d2S2WkLA==","shasum":"658ac757032f276399c41e65e355bace2da4a030","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlHBrNX0ace6Ib1QKILklufxTtJcFXEVlXWKysqAzRGAiBN0CwLOLhJy5zVKHZ0RSaZNi5wbxxQPCWBRivh8ywh2g=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4.tgz_1501773554327_0.73451634705998"},"directories":{}},"1.8.0-beta21":{"name":"alfresco-js-api","version":"1.8.0-beta21","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"c422a3b69b1b96f72abc61ab370eff53590f8ee4","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-beta21","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-3080cGDNs3lRVr5johR8mWtpLsd4Ul6g95CamssZi1cmdZuiqatFcEdSahUJPEBWNqfCOOg8dQsY0bRVLvoAGg==","shasum":"bd6e5cba719022d88aea6f31a23b9bb1af91b7c3","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-beta21.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAEdSp6QMFPOJkpME33djWWNCN6CtxTgSXPwV9N0yWv+AiApuI9U1ZWXlyOba3WXw5bS+6Mu0ihB9AfEi3WUH8qeCA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-beta21.tgz_1501855347552_0.9380111969076097"},"directories":{}},"1.8.0-beta1":{"name":"alfresco-js-api","version":"1.8.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"c422a3b69b1b96f72abc61ab370eff53590f8ee4","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-beta1","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-DjvDJ/7XmrZkle1IVwBn2WpNowpnuyGbVg1crpa5gGQc8VpLlWFb6fCDQQE2mBKEDY4TbgcMUKyxe61syraq6g==","shasum":"e5434189aecf3e42763b73820ac889e8770ebe00","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-beta1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID+9W3wRMEjnt3u0ttTjY7Iu/ibkYuTyg0QueFvXZtENAiB3YjUkZKz/z+7vwopUHQD0QJJ2XE5ug8TZwX9v74fYZQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-beta1.tgz_1501861582966_0.9729778131004423"},"directories":{}},"1.8.0-6f5160df32f7feae4c3a899b5d95940595772619":{"name":"alfresco-js-api","version":"1.8.0-6f5160df32f7feae4c3a899b5d95940595772619","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"6f5160df32f7feae4c3a899b5d95940595772619","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-6f5160df32f7feae4c3a899b5d95940595772619","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-p5nCjDKTHHzpitZ7ouZfJtjZlaJPos5LcswbuydYT6X/c8gpn5V9XqiKmaJjEnd+LfgfLwfqxaVNyGc3kDwWSQ==","shasum":"dafc5abb37acb1884c21d10cde01bf80b1abd679","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-6f5160df32f7feae4c3a899b5d95940595772619.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFV93SQwo89NQnKyIK0SZqW0OALAsDCUqnNDaxI+pTEeAiBkNvUpxgAc+PZQ3h/Lj5VIk9JpQWWhxD962vXxCjSu7g=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-6f5160df32f7feae4c3a899b5d95940595772619.tgz_1502185564366_0.18907528184354305"},"directories":{}},"1.8.0-d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800":{"name":"alfresco-js-api","version":"1.8.0-d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-DoDN8NoQBVrhGekLYdDA8+qUK5gOqANx6X75rdD0CWJtMm0lHSeLUo9t8F6EuPQDIehNvlNylJKVYuXME5ldmw==","shasum":"2a1cf6b7cd97ad2b9098384bbb38c89597ead992","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRbGMVxe1J7+NoDO1QVwmpCpbv8g2Y17Nc8HDmeECWewIhAJet6gt7Wje5wsqlfYXnN0e8h0P0E+HuGLl/ZwEU8uTo"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800.tgz_1502300409236_0.407164987642318"},"directories":{}},"1.8.0-beta2":{"name":"alfresco-js-api","version":"1.8.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-beta2","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-iv3gUv8mhfCZ6p6cLTdYw+JTLDi/Q3XC5WKmj+kTRX/GYYWbfE4avofPJ8iaay5l1gRY01QydoIu0AUAj4EsvA==","shasum":"fd0a9f662b71bf9d1b98e8b457a4082bb0d1dc99","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-beta2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAYi+siN4sYHbWQaNWrteqn6eyNmZywd20OVzahVNexzAiEAtbJjPq2sqk03O+XBjKA/5qsvQXY4pek0RL/m/2mxdcs="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-beta2.tgz_1502460114132_0.20698793674819171"},"directories":{}},"1.8.0-beta3":{"name":"alfresco-js-api","version":"1.8.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-beta3","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6Y4qOPOLTKln7VcLNZNELvljE03GD5DChv5ZKWougm+m4lAtQ99W2++chy/sxlnIlip+TDKb3cEVdEI6JA88sQ==","shasum":"472dcdced523d1b1cb4f699f0c538f41b98d52c8","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-beta3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAk6VcXnI09AwXiT1tGMol0O4pcDHiwHMsNV9pSyLYepAiEAtzG9pDWz7xzTe0P/sWBwMdiFFCoO7blogUM59z7iClY="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-beta3.tgz_1502462246314_0.6752317962236702"},"directories":{}},"1.8.0-beta4":{"name":"alfresco-js-api","version":"1.8.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-beta4","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-CTPO3eo6ozR+nO/AzP36JgTmnQ3L3JL0I6Yo8YY5h/Ij4GGN6ij7CgA151YTme09ft/eLx45eNBv9nL3DC8vfw==","shasum":"9bb1679397fbbc0eba934046972fb64c29f6f058","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-beta4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICvPfjHzF5Ba8X4nqydRTGbrBlt3YXNZ4aZUy55LTIOOAiEA+kDp75Ymp7Ifr2o0rLi5a9PLb/J1H1W46DQcb/sx/gE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-beta4.tgz_1502463397701_0.9918712857179344"},"directories":{}},"1.8.0-9feb5d0164d6c5f994df8758e41ed126a8f69db2":{"name":"alfresco-js-api","version":"1.8.0-9feb5d0164d6c5f994df8758e41ed126a8f69db2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"9feb5d0164d6c5f994df8758e41ed126a8f69db2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-9feb5d0164d6c5f994df8758e41ed126a8f69db2","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-x47sy7uJOSCHkYxm0VBDnRt8/xc0nZ4M/OxEU/Z7ta14/A0HjAnz1dLz6aYEA+Kb/lXZiZesnLnHdQuSmR4jDw==","shasum":"c7efdf567c58e7ccdbc678a8d59494314011f4c2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-9feb5d0164d6c5f994df8758e41ed126a8f69db2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAfCGqiUDoPCsnZYaS/3mRGSL5dx2r9WxzIj0dPr9IiAIgNpzXdnGLHtsOxjfX3DmcLfhKqxcfsjmli2jRy9bSOMU="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-9feb5d0164d6c5f994df8758e41ed126a8f69db2.tgz_1502724462190_0.7082205580081791"},"directories":{}},"1.8.0-beta5":{"name":"alfresco-js-api","version":"1.8.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"9feb5d0164d6c5f994df8758e41ed126a8f69db2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-beta5","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-/vl+qoWbA6QhbFnDFwQSnNigjYL8cXJC1/jEgzIt1FzZ9bovCAoRQ6TPoiyzQBnOni1bK32aWnvrAy2/vEx45w==","shasum":"6bf5f2a499860492e420d230c149f939f1c21016","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-beta5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWP9yIRbMuWjDq5suhJZOM7gCV/twnzAF4wTqiOJGnqgIgCMEUhNhj60A6yZHlroeJsrwVecgj0cyQ2rdDU+huV4I="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-beta5.tgz_1503066178138_0.7464342776220292"},"directories":{}},"1.8.0-beta6":{"name":"alfresco-js-api","version":"1.8.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"9feb5d0164d6c5f994df8758e41ed126a8f69db2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-beta6","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-lSWyfaybC4xNwTNpkGGxmOBFMCPcJQ3RkqDYCCbiHHAVQTyRYzcbAB5jhCjOvJBQIh067iQ8vz0H+2fnvh0eWQ==","shasum":"f5e1a5f8b71d197b298a2e4f20d243a2741e3313","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-beta6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxi/QNM3AtQeLPA1xJpxsC364vsgjLV0AeOO1cu6sspAIhAK/HZZNut+I4P8vHhPxYEh6SOXrqq6eC4sQE8Wlh6sqd"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-beta6.tgz_1503669703213_0.8095408915542066"},"directories":{}},"1.8.0-beta7":{"name":"alfresco-js-api","version":"1.8.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"9feb5d0164d6c5f994df8758e41ed126a8f69db2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-beta7","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-zuiNxa7mCQJdTjgZxb1void3U9UuKTCDefY0tqK45rTkRSzt7k/Ai6CPY3sk4b7X6YyJRAQR19PoGKGpQLTzEQ==","shasum":"2ce49cb87ee0f508852aba86202cfa89f80a878f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-beta7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDORYuSsQnknGYTqpOMffJTZFovAeBXmcHEsAEcpQnE7gIgKnMtFLtAmG+lQkYq2MAuBjh9ien+Td9GzXODhPkys1s="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-beta7.tgz_1504274503256_0.3365868921391666"},"directories":{}},"1.8.0-b61ce4eb17fa24ca248ad00038b78b26d814f943":{"name":"alfresco-js-api","version":"1.8.0-b61ce4eb17fa24ca248ad00038b78b26d814f943","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"b61ce4eb17fa24ca248ad00038b78b26d814f943","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0-b61ce4eb17fa24ca248ad00038b78b26d814f943","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-EN+hQejz2HKO+G2HgTXkEjeXxE3WBWNlM2oaYEfKpnxJb7dodtQm3V6v2iZJESy+XjAyNvBJqYCSJ0xjUkxeBA==","shasum":"760859fe4cf7fede2d58674353cecb014e94c570","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0-b61ce4eb17fa24ca248ad00038b78b26d814f943.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMFlh8U7jRgJwlY17bSUgpCfiNFfjybxZs9OCnnQKCjQIhAO7/aRW8/dyCuAxd4BFhLhPS71f+zgfkqImpT+PS0WZD"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0-b61ce4eb17fa24ca248ad00038b78b26d814f943.tgz_1504606368742_0.2507446724921465"},"directories":{}},"1.8.0":{"name":"alfresco-js-api","version":"1.8.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2e85b01bfcfcea5eb75c2ba33485e7e6f52bf6cd","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.8.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-5EVex1+OtiJHJEfoW7+IuwKOWDd/fb6k7b/MUDMa2adBz0D4G2M6ikDL6DrC0Kg9isLCtyPu5mBdOEfyZ6hXjQ==","shasum":"64bb0863644ecca02349ad6e2d3c6cb75f73da0e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.8.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjxaA4bNYhXwCHpHz4Yp2QcaMhALqPNw8dEYad75c24QIhAPJsv9+bk06O1WWS1SinB3TIDP3wgG1iWPeKCjBxV2hv"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.8.0.tgz_1504622705588_0.1011411533690989"},"directories":{}},"1.9.0-beta1":{"name":"alfresco-js-api","version":"1.9.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"b61ce4eb17fa24ca248ad00038b78b26d814f943","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-041L54lFtJtiNvvNpPiFZsnDBYiTCPmXUg5mApgAKjtalsptuP7izitrAWgM7A05pldQDPWvXiBJbZBkO7AFAA==","shasum":"7afff9bb718e934be78b6ad8d522873259c2ddc3","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAqm+ClZ5Ayoe9FftfzXnMUydpenYIO0Hv0pfgfJmoCIAiBVocuvM1AhPUr0SyxULovRN0NThss412dqhfGf1t7r+g=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta1.tgz_1505147099796_0.6162045958917588"},"directories":{}},"1.9.0-ff96bb801e0e9be60b85248485e5462915657de1":{"name":"alfresco-js-api","version":"1.9.0-ff96bb801e0e9be60b85248485e5462915657de1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"ff96bb801e0e9be60b85248485e5462915657de1","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-ff96bb801e0e9be60b85248485e5462915657de1","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-R0yM0lr6PVcwFbrG6wCILSxW/Ed44fH4mJ1B/tldOpFqk5gFpVFO0+5/RkKchY8pNB3QbacmliWH7rG9ApvBHg==","shasum":"6c4b456c5e01be79d90d0b17f8515460c1b8af63","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-ff96bb801e0e9be60b85248485e5462915657de1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+L8fXj0lPPIiibcVHiwIUsl8YhnyEpDtYt03N2tcLXAiBseb02NF/uaZjZ+VZ9IaTkYg18briduVyNvWq9Dg+1iw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-ff96bb801e0e9be60b85248485e5462915657de1.tgz_1505389790977_0.6814803665038198"},"directories":{}},"1.9.0-1c9d7d88c65e85189eee82768d5782ad7af935fb":{"name":"alfresco-js-api","version":"1.9.0-1c9d7d88c65e85189eee82768d5782ad7af935fb","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"1c9d7d88c65e85189eee82768d5782ad7af935fb","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-1c9d7d88c65e85189eee82768d5782ad7af935fb","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bUl1NwWOeZxXydhH0mc9GQQqs+dQ+LKjzYsImeKhR85mPOYcq8ej+v1hDDftq1qejB74YgRo7OheEhzlFLn19w==","shasum":"53ad3894860226b5832b4658f3fa935ac9e0293f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-1c9d7d88c65e85189eee82768d5782ad7af935fb.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGfV+ZlY3BUfza2btcAhFBNWjxWQbDQ1jIjqidXUqE3UAiEAnDIsaBsvgbWNOGuFTQqUaX+HAcPwHDEL/maRVPTliIE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-1c9d7d88c65e85189eee82768d5782ad7af935fb.tgz_1505415355082_0.9321359032765031"},"directories":{}},"1.9.0-ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3":{"name":"alfresco-js-api","version":"1.9.0-ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-RKdYalbGTQQ64Ug2WbnXo0LgX2uP5+BKoFzzMVo8sDumq3liY62VKvKoY4QxWTplq0vpbDgMwHIBcXapCVb7pA==","shasum":"6c3331f1dc002c540729564e03d31303e3f6e288","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCigB8NwQpwtVTd0BRXU3Q0N8wJ8+y6gFFcS4iFn1t37QIgDjuoCrSzlg80EBHXi0I3TkTZ7Ely1d46/mcnyZGSSGk="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3.tgz_1505469166311_0.25843329005874693"},"directories":{}},"1.9.0-beta2":{"name":"alfresco-js-api","version":"1.9.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta2","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-g+wSs29sZqqcDnX1aDx3rWBncK/D/s7kKoiVFIZU6VV82BewtUyoYywGsC67V2e34yj/Ua+SoHsE52sI/Cm6Mw==","shasum":"7b6bd816fcf9588cfc188a5f3c854fed68c8bfbc","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFnE0oT8z963ly9iNB/O2qPph7IWSgFe5sJ7frFcvePwIgO7P9ppAVj/nkt5pqT/jObw1zIfon1S799mJKoEFmTeQ="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta2.tgz_1505499782949_0.19494516146369278"},"directories":{}},"1.9.0-beta3":{"name":"alfresco-js-api","version":"1.9.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta3","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Nw6igOVyovZ4RQhx6cr2CKSb7L0EvZDAnMmGbqPlb1AOZUjqVy/mhu/fv2x4ssyHjhBxkm2DVjCCgGotKTQ5BQ==","shasum":"738d13cbcd234a93ee9b02e5c5290b5599628acd","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWZNq/oyc7ZUxCkuu0p1W1yxYosp/AmYmMhBI6yKED+QIhANlySzwDZbCyWEHf56l1q+rrRtzTXL2eCsPrv5cZ+4+W"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta3.tgz_1505501771283_0.6533783697523177"},"directories":{}},"1.9.0-f8dc41f05b163babb95dc1857ab1adb819e73933":{"name":"alfresco-js-api","version":"1.9.0-f8dc41f05b163babb95dc1857ab1adb819e73933","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f8dc41f05b163babb95dc1857ab1adb819e73933","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-f8dc41f05b163babb95dc1857ab1adb819e73933","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-SRG2jLZkCTPmzU0EPE2aXV6AQIPBcvtfP4PtkRtcmWS9IJeIW+RaYc4mAZmNhaXV15mIqzYoMTmHVaxUK7Q8Rw==","shasum":"94a0922e58252826ddb0c6f5c4eb244d088cbcf1","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-f8dc41f05b163babb95dc1857ab1adb819e73933.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdrvmsBNEiJS6d3BaJCu+U9aMzn50+pw9Vs55M+34RVAIgLFQLCy8v+apzrJ+880m88fNPb5IRxXqH3w6NxYpJW8A="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-f8dc41f05b163babb95dc1857ab1adb819e73933.tgz_1505750686164_0.9309613455552608"},"directories":{}},"1.9.0-beta4":{"name":"alfresco-js-api","version":"1.9.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f8dc41f05b163babb95dc1857ab1adb819e73933","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta4","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-mt3PasZoohkD6dDYUdhxUjye0/Ry0i4oBk8NHqloIUGeUQd/T+8QgHc8lrwEK4c6GFmpD7crIGS3/7g0WJP1cA==","shasum":"40a06f18961163fc807d4585066f1957595546f2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNskXZTRAIIjP9D28nEJWSAXJZLiXrXkk2z+wxni68NAIgfqCTHHQtQ14IJM2Hqupmgn8hgRZqypU8cqtbfR3ry5A="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta4.tgz_1506088905747_0.732589130057022"},"directories":{}},"1.9.0-beta5":{"name":"alfresco-js-api","version":"1.9.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f8dc41f05b163babb95dc1857ab1adb819e73933","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta5","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-OMLg/1u5kUBXMOwUfhXq7ddKRxyW9KP1AhK4GTm2vDm0gECRwWiVubYS6/9I7KxmkB96TdXptIpLsobhiJ9kfg==","shasum":"e7e378af34723694a3ac92db1b7a1225e6f7689f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCa3gmNa2xrJfydcI1XiWQ0HsIT//PHoyF09C62IoR0nQIhAKBPSo6xyBBHbvLKd1bQaYGJkTLJaWPf11bY/x1NLMR3"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta5.tgz_1506266591297_0.5832650088705122"},"directories":{}},"1.9.0-beta6":{"name":"alfresco-js-api","version":"1.9.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f8dc41f05b163babb95dc1857ab1adb819e73933","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta6","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-g71tn87lweOGN9rUUepcmKIif2yLyoD9PetIchi5HHgaVf3GaXjmrw2pb8++KeoM1mAu3teF1cMt6QZpEwejkA==","shasum":"f924de5c1a2bedfab63ccd4c8bcbd154274483ac","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA/LfCN8pHmDxg4zEOIlhWeuqNIrRdJic9x4T34CVJb4AiAlwicZKRYHob5/Ow1Df3No1iXr7yqdUQyxGTTxNzKTkQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta6.tgz_1506269079425_0.7202139082364738"},"directories":{}},"1.9.0-beta7":{"name":"alfresco-js-api","version":"1.9.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f8dc41f05b163babb95dc1857ab1adb819e73933","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta7","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ArcGu+qOg0vN+c64aj/toCIWm1y76E90kDilKGHNCeZTkuTOA/EuSIkBkotzidZDouLVnCkrppkQrfE+0nhRMA==","shasum":"148154b3b3f8cc772d96b96ea6f59905e83ce90f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0ZgzrED7/k6dwi0KaZWKWaDg+6s+wn/rBiZNihG+IIAiBIHTrH9nA3TaecMBcppsHtBaZm7rgql4XgH/gjYkkoRg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta7.tgz_1506693706331_0.2663283352740109"},"directories":{}},"1.9.0-beta8":{"name":"alfresco-js-api","version":"1.9.0-beta8","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f8dc41f05b163babb95dc1857ab1adb819e73933","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta8","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-NzBUBULAicg7eOQUQkHKruwtTo2I2eDgdyYE4EqNvkXSMyToGPFIprYd+wQAnAJLNib+5Losx0Qr9qQqjFWwTQ==","shasum":"f1587b73885cfeb6aeca2317edbc8a06ce4bcfe3","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHdx7Axn13qyoYcJEwjvIvugXoTUK202dFeVtbyhSCggAiEAxLSzs9KFQV2BD+gODADkGe8UIzrUhVgzLvQtsc+24bM="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta8.tgz_1506700378146_0.6706861928105354"},"directories":{}},"1.9.0-beta9":{"name":"alfresco-js-api","version":"1.9.0-beta9","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f8dc41f05b163babb95dc1857ab1adb819e73933","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta9","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-h1EMvPTj2FicZ9792yisHdA2Mj2hF6XIs+UCQaMTrwaFTQ/TOXjXVDFUixRRyZqeJxfCiACMaNWNg5lhhAjaqg==","shasum":"4d064558ddfdbe3578e0f19fa1700bde4cb8b358","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta9.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/nYIDKkmXd2JQ82HLGL5S5esO1itiYR2Bo+v5mk6pygIhAI/2M3eEQgYj4S07cinnECmosQOXaiix7G6ZRNW8s7bV"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta9.tgz_1506707525883_0.7938822256401181"},"directories":{}},"1.9.0-1a4a5bf12361a7829048bbb055a612ad8450119f":{"name":"alfresco-js-api","version":"1.9.0-1a4a5bf12361a7829048bbb055a612ad8450119f","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"1a4a5bf12361a7829048bbb055a612ad8450119f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-1a4a5bf12361a7829048bbb055a612ad8450119f","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bPdhx3s3zDs83DhPYRHpebW6ZX441qb4YGj+2Ws5Ym/QsBtpqRAM0tOlcj+pBpkiAWK/o0KQnqvFIwO44u0t0Q==","shasum":"68ac29599c264f80f0a8e7952b1b53ddaf647493","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-1a4a5bf12361a7829048bbb055a612ad8450119f.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLdvyS0GUsHTx9TLZg/sm2CRjHpDqYDc7vnjSHMFtBNwIhAJNvt5VXFDtZvsybtBURu2ILLMOeKI+bMhfE4Ks3ulEo"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-1a4a5bf12361a7829048bbb055a612ad8450119f.tgz_1507136322040_0.7633709302172065"},"directories":{}},"1.9.0-beta10":{"name":"alfresco-js-api","version":"1.9.0-beta10","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"1a4a5bf12361a7829048bbb055a612ad8450119f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-beta10","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ypgGRPbBtUf/Bkpug9k2ncZaBVX+BAiv/ln2sM81FlQ5gYYrZ28skmLDXq5/CDMjEH/s/GTmYQrzJ8iDSCbjdg==","shasum":"526ab890d57f7fa65026b64afed0da4b9109076e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-beta10.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXT3Uj/Z4JnXO1RjzDc+mRZK3Ih300tkC0thVez/M1zQIgZkTlaiGamG1RQP47D2k9A56b2m/5Am2UJGQVGmsS+8E="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-beta10.tgz_1507298453566_0.4959431567694992"},"directories":{}},"1.9.0-361d8a2ef40b4065d91c20f7874964f4076cd0ef":{"name":"alfresco-js-api","version":"1.9.0-361d8a2ef40b4065d91c20f7874964f4076cd0ef","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"361d8a2ef40b4065d91c20f7874964f4076cd0ef","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-361d8a2ef40b4065d91c20f7874964f4076cd0ef","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bZ7Eth/x1GEWBdaeHhp1UmHVjwnbLjnPxbpfSyhPREH0sn2nCSA77T5L73L9Nhw6bloHb/zHH0eD/pS/npLp/Q==","shasum":"433673a77c4c45dac5f08025241dd05b6f4f5da6","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-361d8a2ef40b4065d91c20f7874964f4076cd0ef.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTlFx9q3gjlWgXCR5GyPluxODKga9KkVXYbf4WMpzjyAiEAxepHX+X9TshKViPNxzfVkuJrncv4llkOV5GHJ77VxNE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-361d8a2ef40b4065d91c20f7874964f4076cd0ef.tgz_1507300661389_0.29201493016444147"},"directories":{}},"1.9.0-7a44e8b4b78feecfa493cde6a176f26aef9329ac":{"name":"alfresco-js-api","version":"1.9.0-7a44e8b4b78feecfa493cde6a176f26aef9329ac","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"7a44e8b4b78feecfa493cde6a176f26aef9329ac","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0-7a44e8b4b78feecfa493cde6a176f26aef9329ac","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-u6FwYmqzZSydPB/evlrNpiKN5BnLW9uaJR1akWBjsuQLY3XtnE96213DaQmRltuvpeoSGB3Sxx2JWSmGR469Og==","shasum":"6b9a33f8ad73e0bdeae37161fa92d76ed19f2027","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0-7a44e8b4b78feecfa493cde6a176f26aef9329ac.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEvwgSCtRCa37eIh901GyiPRj+xF4Ejv4qqSFD9JCMb3AiEAhxmiiN28zz3q94OvESbgAOZpa+/lJgGfCDXDEX8axLo="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0-7a44e8b4b78feecfa493cde6a176f26aef9329ac.tgz_1507544741323_0.9004107401706278"},"directories":{}},"1.9.0":{"name":"alfresco-js-api","version":"1.9.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"4eff76b98318add3697ea6f74146118c916c220a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.9.0","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6VSR2yzc3Yc3gQWRJhKRCwGuHJrAVI1A7F3ssO1iieEhtFuaq1SvA1qeBP6U1jXt/nC++Kxnrb2OyZAnOdwzew==","shasum":"8ba236d79bb73324e7c5e68c80917ad0b9259953","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.9.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFYLTNQOcScPBB1Qh+DwXQd5+xfXCIHYsb/RzWawKZ46AiEAjVjA1d2bulyeNkrIMclX7hM8xgzQWsse7tj6BaSkHuU="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.9.0.tgz_1507566193861_0.6707135136239231"},"directories":{}},"1.10.0-f280fcf0ca3ff0d5b5a8cdd3895ae5c021255c39":{"name":"alfresco-js-api","version":"1.10.0-f280fcf0ca3ff0d5b5a8cdd3895ae5c021255c39","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f280fcf0ca3ff0d5b5a8cdd3895ae5c021255c39","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-f280fcf0ca3ff0d5b5a8cdd3895ae5c021255c39","_npmVersion":"5.3.0","_nodeVersion":"8.6.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bro7p/AMVX2t7C4RWiFRiiAQ4q+lfVxWuK3bg1dDkcl98L1KqCZt9TM3xPO0tKZme/aWbkrxxcYn6fBJ0UFwIw==","shasum":"7cedcd5310b08fc3a6b1c65dd975fea52bc6c074","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-f280fcf0ca3ff0d5b5a8cdd3895ae5c021255c39.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKtVNlNz9J2MK49AsOfkC2epGYW6cWX4FWNPjdw8cRUwIhAJp3CEWb5C4l7uj1vs8ukn7a1WWZvWdqBq7tIiqFD/Z6"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-f280fcf0ca3ff0d5b5a8cdd3895ae5c021255c39.tgz_1507726003627_0.9363680544774979"},"directories":{}},"1.10.0-3c6d7f506fff6cfc66767f85c4b6eaed96e6b9c0":{"name":"alfresco-js-api","version":"1.10.0-3c6d7f506fff6cfc66767f85c4b6eaed96e6b9c0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"3c6d7f506fff6cfc66767f85c4b6eaed96e6b9c0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-3c6d7f506fff6cfc66767f85c4b6eaed96e6b9c0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-KlyRlx5z9NJTjen4FwnrPCi5I5KShjbW4gu5tdMeSgQygisPAUZIP0XYdjqRhI+CDwEGGoVo++94XhK3rWikuA==","shasum":"3d15f043a02ece1731510c6708d5fe8db3d42c5e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-3c6d7f506fff6cfc66767f85c4b6eaed96e6b9c0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUoYRdUqYYsV0NHLLCjYUnQWUv5ufQEnCnbr3Jr38VMAiEAmq1pb62eNxu0J3aoCmecKSNuCG4HLcPzt5WKRnrKmTA="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-3c6d7f506fff6cfc66767f85c4b6eaed96e6b9c0.tgz_1507900051689_0.04152116575278342"},"directories":{}},"1.10.0-beta1":{"name":"alfresco-js-api","version":"1.10.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"3c6d7f506fff6cfc66767f85c4b6eaed96e6b9c0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-beta1","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6s1P7PEtrTIuKXXmFZVNgaDQE6YMjN16c3eql/BZdj/0P4GaIsTqc+PQqApTXMcBTR21Nzx/XbvOzWdHrMyFMA==","shasum":"066e25e4278d4ff0c9bdf05a8eb202ab22c46bf3","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-beta1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpzS3Atr0ycthhsCJbSxb5F+OIfC5xIw7RWZZ86EOCTgIhALCvEcTld+7B3XtF9yjWFRe2G2nYAHMBpNuKuTIPAnsa"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-beta1.tgz_1507903286056_0.12195685366168618"},"directories":{}},"1.10.0-fe41c7a612562143aabb3dddfc1093fee5e4c472":{"name":"alfresco-js-api","version":"1.10.0-fe41c7a612562143aabb3dddfc1093fee5e4c472","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"fe41c7a612562143aabb3dddfc1093fee5e4c472","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-fe41c7a612562143aabb3dddfc1093fee5e4c472","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-NJuaQNnTpOGkyTw/mlBkK4VzBGb5hPxD5dT4Wol7mC0TIqi3rQ4YjDGGmWHisiA0AAdDQ4cJKX7UMJ8bf9YPeA==","shasum":"a4d24970a13025a3d13448cd29a4b241251c2601","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-fe41c7a612562143aabb3dddfc1093fee5e4c472.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDt2c0BE5GSY/NU0FQvj5fF8M1QdjCiGcNMyEos7nhy+QIhAL9QscZ6GVWmSt/kXh/S5xyvSaXDm2qmf2jEU95vZfwS"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-fe41c7a612562143aabb3dddfc1093fee5e4c472.tgz_1508262391239_0.8018388114869595"},"directories":{}},"1.10.0-beta2":{"name":"alfresco-js-api","version":"1.10.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"fe41c7a612562143aabb3dddfc1093fee5e4c472","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-beta2","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-BLvGGBKTAVDzuXiIBNxREd9vHyJCcsxaVMLGHtd7B01rtUbXbDw3sbPJ7HHNdsKaFrTHi5/sOUOrWwK9YEi6pw==","shasum":"1a7daddf29cc22d34e1e1da765b8c45c518aeaad","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-beta2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZuGk137nK7BrNRyclsPuMK9ImDx3r8deJDEZE274NXAiBpDfTWrenKFSb5YWiCZjMc8bNu3tc69tuXgkD8fN1XjA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-beta2.tgz_1508508084802_0.4285953617654741"},"directories":{}},"1.10.0-beta3":{"name":"alfresco-js-api","version":"1.10.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"fe41c7a612562143aabb3dddfc1093fee5e4c472","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-beta3","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-/4lcuezJwtb8J9CoLKwr4PNhlqxcPfVZIPgqZeFLzF+Jw1ZhdGM58XJW6+hOjbTXYjFJiBEGfaNlVkK6WY6txA==","shasum":"2cc0ccb5c798b5f274e4d824679cf753bc3a04c8","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-beta3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBRkiUs8Hoj+9Cf/TA6BESUm4AGb8Ai3v5KBuHasDCchAiBSguxJDczaeM2BkSET6joAVoyyKDcvHrzoEoasipZnQw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-beta3.tgz_1508512481069_0.8177474176045507"},"directories":{}},"1.10.0-40cd394e0fc8214fbbc659484e370e6c3cc0901e":{"name":"alfresco-js-api","version":"1.10.0-40cd394e0fc8214fbbc659484e370e6c3cc0901e","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"40cd394e0fc8214fbbc659484e370e6c3cc0901e","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-40cd394e0fc8214fbbc659484e370e6c3cc0901e","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-M+vnTb1DNVVSEYwfUDnqCilzeocDcId7pzj4yCkyTlUrAuH2B+fVxr7U189rWT7tSwn/qQODPDlYmbx/VKeP3Q==","shasum":"4d0e25419df8242fd6a014aa8a98254ffeec4f51","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-40cd394e0fc8214fbbc659484e370e6c3cc0901e.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8UUGSPBeecwJTUHDC0atZMY1Jc4pYyb0Dr/LaP/ouLgIhAMhpMKkjZ0B2Z2vCHZ5XUpBlWugqIhyR1o2kqQaR1D7D"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-40cd394e0fc8214fbbc659484e370e6c3cc0901e.tgz_1508861973889_0.2915293541736901"},"directories":{}},"1.10.0-86194ff764a25ffd90a1ccd04817c1123ecd05dd":{"name":"alfresco-js-api","version":"1.10.0-86194ff764a25ffd90a1ccd04817c1123ecd05dd","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"86194ff764a25ffd90a1ccd04817c1123ecd05dd","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-86194ff764a25ffd90a1ccd04817c1123ecd05dd","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-QTrSpAMZFkgDEl3xax+4lKNEy1z02E2lOhv5sOv/PiLlQxY9x1XR+BVOb5jZ9YomLyYmE1MAnasRk4dRAOrW3g==","shasum":"12d5be9ad55bdf7cc8537f9ff51dfa91e11f1f95","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-86194ff764a25ffd90a1ccd04817c1123ecd05dd.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzu3RmTUUC+Ads4vDd3G2ptWFayMkrUQHYIUF3+BLmMAIgCYm60q6DS+QSs0/vtAVmm3n0vWspwMZqRlet8bES2lw="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-86194ff764a25ffd90a1ccd04817c1123ecd05dd.tgz_1508864674842_0.9689545284491032"},"directories":{}},"1.10.0-1b950d165ae7107159b02fd75680f782d825d5cf":{"name":"alfresco-js-api","version":"1.10.0-1b950d165ae7107159b02fd75680f782d825d5cf","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"1b950d165ae7107159b02fd75680f782d825d5cf","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-1b950d165ae7107159b02fd75680f782d825d5cf","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-0uK0f1PvLUDQdmHRNWqxowq7xqJX0lKHRF589vdUNJHP4wmeA8uMj8+yVS8TZGpxijIrG+ZJ8XI3u/5c953+EQ==","shasum":"45508c569fe34dd3d2701493775f621506e43182","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-1b950d165ae7107159b02fd75680f782d825d5cf.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1aYJt/i9Uz0WRapoms1Vul1uwdunw3qk5K8ymVFK28wIgKYANdmNElM2Mo5jrxGrSXADS4DPvwphdjW+FYH8S3FU="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-1b950d165ae7107159b02fd75680f782d825d5cf.tgz_1508882305786_0.015120120719075203"},"directories":{}},"1.10.0-512ce97b552d42cad9c713fa3cbea229c0dc519c":{"name":"alfresco-js-api","version":"1.10.0-512ce97b552d42cad9c713fa3cbea229c0dc519c","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"512ce97b552d42cad9c713fa3cbea229c0dc519c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-512ce97b552d42cad9c713fa3cbea229c0dc519c","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-9kLnftp83MYBIVUen1fD5nul2mcRWGGiIK7mJaW6T5x6B8cfLZsZL5bUzHkNLRMSwn+Tj0OQLll3+5E+/ygz2Q==","shasum":"37191960a0fe2bcdc958fb7efdcd3749333c6360","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-512ce97b552d42cad9c713fa3cbea229c0dc519c.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFmkSQhRHCnib8KmNszIrLJsuZ2XGDyntC7No9cpOIbwIgbgT1QVwZUNPbhqGfs2qwrVmWcOpm06N72450pdkXAB8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-512ce97b552d42cad9c713fa3cbea229c0dc519c.tgz_1508936543957_0.1596109769307077"},"directories":{}},"1.10.0-11228ed731b8894881989e2ec62e3f3390d91636":{"name":"alfresco-js-api","version":"1.10.0-11228ed731b8894881989e2ec62e3f3390d91636","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"11228ed731b8894881989e2ec62e3f3390d91636","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-11228ed731b8894881989e2ec62e3f3390d91636","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-BACXu4+9QHv6ypSyzv98W34be4zLz6jMGtVRlCtMareBe1wbGJ1F9y6zg3ZCMzQ03Ay7rOUobS1f0QbQcy3lGw==","shasum":"647c73ed8b6365f8046fc4e6b0c3f3faadddd6af","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-11228ed731b8894881989e2ec62e3f3390d91636.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8U5OUc0VvtQ/zx1y6jlekW5jxw0glC0f4yJr3CryiPAiBeR7TN3ITVNQIGSYzNUmMf2ynH+gcvuylIVXDeVgKjBA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-11228ed731b8894881989e2ec62e3f3390d91636.tgz_1509026179550_0.3396242829039693"},"directories":{}},"1.10.0-beta4":{"name":"alfresco-js-api","version":"1.10.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"11228ed731b8894881989e2ec62e3f3390d91636","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-beta4","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-/7CYvOh8FpNEeK1ILg5s24O6t+VAzuOUfdRv4N2VCD6nm1Dlsp5nG/So3QdEjL2oKtzBFHIyDDb5qi/a9j9hYg==","shasum":"b284ce86d4777cbf79200a519de8dc642b3ca06a","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-beta4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICDOGRhPePH1hEMIm+fU0yawoNhfw9n+JVOJHF9UioOFAiEAzzZ7y8PtJWxnfnPq6Xrf086mlbhYZQna/ZnLRfJNEpw="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-beta4.tgz_1509112935450_0.5614761298056692"},"directories":{}},"1.10.0-beta5":{"name":"alfresco-js-api","version":"1.10.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"11228ed731b8894881989e2ec62e3f3390d91636","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-beta5","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Nh8ai9DwnH4x/r1+00occYl+M5xzpbzBjuXcFGN6Vt1nqOrs1u48FEf6eT5go9YGDneaq2zXULyuXFS787jZsA==","shasum":"6b3b111b1774b6b81a51f0ad0e5f7c24e5e234da","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-beta5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFf09CRc7AjNkDvSSBmVUSFDFN1y1kz+78fxVx2NMhFaAiBe2zFqWkJ+YcJaCXuNLwlCRa50PwJ7iL/vQI7wREuGvA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-beta5.tgz_1509472632918_0.043377842754125595"},"directories":{}},"1.10.0-6a33f81d4052d76586d4443defdb7a55de28cc1e":{"name":"alfresco-js-api","version":"1.10.0-6a33f81d4052d76586d4443defdb7a55de28cc1e","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.4.3","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"6a33f81d4052d76586d4443defdb7a55de28cc1e","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-6a33f81d4052d76586d4443defdb7a55de28cc1e","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-F2Z9fLAgW8OpbBDP+XJ0j5rLz9UKRQaAz3xCVJZ2ZplFTKxFa+w0THBfSzJ5ZCNStQC68S+a3fB3xu4RmhKzVw==","shasum":"3b82cef25896a2a2677e307d0bbbb4fb7d1d0a14","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-6a33f81d4052d76586d4443defdb7a55de28cc1e.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDheZbnl0la92lpLNbRA1aagwHz+KzRWKx1Y5S7Kzc9BAIhAPDJe0RyU0wYunoyOQqanyf8V1y+9qkIyJpvyVt7IWYu"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-6a33f81d4052d76586d4443defdb7a55de28cc1e.tgz_1509639552055_0.9559633645694703"},"directories":{}},"1.10.0-69bdb7528f216a0cdeb92f04594121124fd95033":{"name":"alfresco-js-api","version":"1.10.0-69bdb7528f216a0cdeb92f04594121124fd95033","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"69bdb7528f216a0cdeb92f04594121124fd95033","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-69bdb7528f216a0cdeb92f04594121124fd95033","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-gKFnxMURbuybPXhVMCYN9VI7KZCNsgPM5GSfHCW24NwJuB/4pFWCPQ9fKbirM6Xdsd4iRzlCXtj+wqF9xwPcwA==","shasum":"e7a5166e13b505c7e23f0616037993cf9caf5529","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-69bdb7528f216a0cdeb92f04594121124fd95033.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFrIiHzPIkKw1sjnGhFD7hvauOlMymQXqiAV1hoHqXHvAiBLqr/BD7MEz36rKRtPgFM35ceKz1rgH/PSq+yHiLdnVQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-69bdb7528f216a0cdeb92f04594121124fd95033.tgz_1509644767909_0.10795704694464803"},"directories":{}},"1.10.0-c3eb559911efc0a3297a6c770954fe0011a25245":{"name":"alfresco-js-api","version":"1.10.0-c3eb559911efc0a3297a6c770954fe0011a25245","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"c3eb559911efc0a3297a6c770954fe0011a25245","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-c3eb559911efc0a3297a6c770954fe0011a25245","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-VQIXvyJR2tY9e8Epu910W2DJmsuAOk/+Xg4BsCf2wZjjRyRXTUm5NIv2wiRjE0USZDJ8wUZpsN4z1DWbqHHG4A==","shasum":"641ffc8011830b33e83912b18aa9a2b7a01782e4","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-c3eb559911efc0a3297a6c770954fe0011a25245.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnPZI6sYAU1oZwW2vTX58big5jMVEEI/0lU45jw34YZAIgLwQ4gX0NJliragXPu/mwoHoe35bz+OEi/xW4gdLe1t8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-c3eb559911efc0a3297a6c770954fe0011a25245.tgz_1509719723730_0.27803238946944475"},"directories":{}},"1.10.0-79d7c47d02f9910e657fea48a4f7d4d37a218959":{"name":"alfresco-js-api","version":"1.10.0-79d7c47d02f9910e657fea48a4f7d4d37a218959","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"79d7c47d02f9910e657fea48a4f7d4d37a218959","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-79d7c47d02f9910e657fea48a4f7d4d37a218959","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-FEu1I86k8lW/dYBxcFASDgBTak54wzyccHGcG0RzCJGa7HVQnFNBnr/M4/Bpalno61SjkRzenXZ8nes91PLC9w==","shasum":"47955c3f03f27a621ecd1595c349d4737222ff3e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-79d7c47d02f9910e657fea48a4f7d4d37a218959.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTZqFoH2Y/OeQKH0okcC+hL63IU8BNCfU9L0lCFC8dCQIhALvi5su/cYn3XvEjd/TZnlYoSUE37nunMlhM3QpRfmvX"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-79d7c47d02f9910e657fea48a4f7d4d37a218959.tgz_1509719824509_0.5560156228020787"},"directories":{}},"1.10.0-beta6":{"name":"alfresco-js-api","version":"1.10.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"79d7c47d02f9910e657fea48a4f7d4d37a218959","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-beta6","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-plIFsw6N3S3wrNQbsAZUsF8GPN5q89OGkcYyrAZ56d2ioh27fvsHZlo8L2+Zeyrvp7NAsmKKrGbpiPgy7hyZpQ==","shasum":"c988a46f81ce17c70edd053d03b95d61ce5447f5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-beta6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF8j2mh5L+/IvXoP/M2jreBa5FXIIprwFu9t47hed7agIhALtheLFUbz65tSV5z/R9/pWr5d0MJWy/+H8mFHhboDNY"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-beta6.tgz_1509721267318_0.411451302934438"},"directories":{}},"1.10.0-beta7":{"name":"alfresco-js-api","version":"1.10.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"79d7c47d02f9910e657fea48a4f7d4d37a218959","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@1.10.0-beta7","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-9Li2eEsLNgImjhd7Qg/wbNiHLNevRGmnlYv3fqUhicJ27melENFCdHlct4G8XmU2Js3SbV+j7G5vS/11ceLICg==","shasum":"e8fcc8bae8de630855d675f0696bc8bd1a860935","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-1.10.0-beta7.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXHg9ALXbeWAtxSYbDExQ7O86X8S8a9gLDsyi/nF2TWAIgS73saiPi8aI3FX4EAEI7VqKIVL1DJrvkxXfY6Efb0kc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-1.10.0-beta7.tgz_1510326073291_0.8298921457026154"},"directories":{}},"2.0.0-de41fd8ca9c1c6f6072d2e06415eef0a71330dc0":{"name":"alfresco-js-api","version":"2.0.0-de41fd8ca9c1c6f6072d2e06415eef0a71330dc0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"de41fd8ca9c1c6f6072d2e06415eef0a71330dc0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-de41fd8ca9c1c6f6072d2e06415eef0a71330dc0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-07rr7UNRL5GLkETPZarN3rJQ4VOF5Fp9y/ia28sDsGGuwOjlVkbANg3df0egoatjj25nhp04RCo5AOFm4BY7/Q==","shasum":"207e91f7ffbba4ab586490f1f3999ba1944cfd61","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-de41fd8ca9c1c6f6072d2e06415eef0a71330dc0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfyUfZyzBLhvBqQEoTPRqAJzhgJxLmA0rbvQiBV+ZnKAiBjAqngusQXH0goqm9Va6uf01W5nK9vxCHm8tUo+79jeg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-de41fd8ca9c1c6f6072d2e06415eef0a71330dc0.tgz_1510669330914_0.5712764880154282"},"directories":{}},"2.0.0-0fb708e3e63eaac6e33a18b9393f561c4e1129b1":{"name":"alfresco-js-api","version":"2.0.0-0fb708e3e63eaac6e33a18b9393f561c4e1129b1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0fb708e3e63eaac6e33a18b9393f561c4e1129b1","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-0fb708e3e63eaac6e33a18b9393f561c4e1129b1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-RkW+wW0qweiHgMwpj0ppdD2Z2rPjL7pYGtmliyfUTLEjdNI5de+U7uPuCPL+E94plKK57AIGqctPX523VqnSnQ==","shasum":"86f915bd500e61cc075c3f5a7fe1d54ecefde2e8","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-0fb708e3e63eaac6e33a18b9393f561c4e1129b1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRN1J5MWQtMC8npPLPbTAhrer46Jx2v4zep9SzIKvIlQIhAO04E2SaIYAEMHSqqTr9EWPSk0qk1/WhtJQO8Z3hMmtp"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-0fb708e3e63eaac6e33a18b9393f561c4e1129b1.tgz_1510676176250_0.6081138476729393"},"directories":{}},"2.0.0-d5da84a4c1ce12638a47f33e2fa78174af0e70ae":{"name":"alfresco-js-api","version":"2.0.0-d5da84a4c1ce12638a47f33e2fa78174af0e70ae","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"d5da84a4c1ce12638a47f33e2fa78174af0e70ae","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-d5da84a4c1ce12638a47f33e2fa78174af0e70ae","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-zznQ8BpNqFIuMb8CYJmO+Hb6cHJfdFDxKjop4fQtCJmcK/Vz/9nWKkSwtCxJAPoZ5HdOK6hmK9ra7NVOx9lguA==","shasum":"21694a43b7a403b383daaadeaa026e998e0b740b","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-d5da84a4c1ce12638a47f33e2fa78174af0e70ae.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDk3zJo/OU1H1mtJ050iBq7jUkasmdeUR+5dxXSp4yonAIhAOO0jiQQkWBatn0KOKWBbGoumCYBXgexVU9V18yFUCqu"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-d5da84a4c1ce12638a47f33e2fa78174af0e70ae.tgz_1510680488033_0.008180183125659823"},"directories":{}},"2.0.0-a5057a6373212ca42e5c29a1a2550cc78dca53ad":{"name":"alfresco-js-api","version":"2.0.0-a5057a6373212ca42e5c29a1a2550cc78dca53ad","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"a5057a6373212ca42e5c29a1a2550cc78dca53ad","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-a5057a6373212ca42e5c29a1a2550cc78dca53ad","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Ex2L2amt0noEjw8wqmWk0jjm5nNAsJyxrjLjoWqUaKoUuSYySdv3ChZdtDDEm5yKmMJHZE4+Kr161Q2fBS/XuA==","shasum":"faa7e7c22a0d7d0901ed5a3aedf0d003b2a5881f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-a5057a6373212ca42e5c29a1a2550cc78dca53ad.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGiLVQoN9lEdrhxEJhS430LBkzWLqHalfiwZ2brdcVwsAiEAob5pbA/0x4uG3h0O6pCiWFPRssivDQEDli7KjK54se8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-a5057a6373212ca42e5c29a1a2550cc78dca53ad.tgz_1510931949986_0.9297008188441396"},"directories":{}},"2.0.0-beta1":{"name":"alfresco-js-api","version":"2.0.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"a5057a6373212ca42e5c29a1a2550cc78dca53ad","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-beta1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-hkSKom9s4zqXGvUI6Sb846pCmVSsvBBgELf+2apu6Iw+Sm4GQiZzt06hbCpd0LcGt3tx+/So9YFBT6M4aMNeeg==","shasum":"f52f8dfb82e3516efd71868f06cf91c62e4fa71e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-beta1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG9XRhZ08UbipZ2fQXtZ9n7WaQisMe+gd/4zyKZwldoIAiBTWawnShkVcUm0N8cHkruMRIhUBG06KwHe+i5zMA8Svg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-beta1.tgz_1511016478397_0.8020891067571938"},"directories":{}},"2.0.0-2e4554a3d3a1265d058795c924d55d570dd46de2":{"name":"alfresco-js-api","version":"2.0.0-2e4554a3d3a1265d058795c924d55d570dd46de2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2e4554a3d3a1265d058795c924d55d570dd46de2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-2e4554a3d3a1265d058795c924d55d570dd46de2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-a4Byem6fYll3xaE09yS2kGWNIEo0SWhtuntDIiAsCwmGXUYcpA/ilJ86gBeK8Z9U005u17Dr/+GP+SH3DjFN3A==","shasum":"9b4cafb16eef618ed449c2d69055cb032cbe9087","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-2e4554a3d3a1265d058795c924d55d570dd46de2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuBAPuB5wItEQlh+yTUo7YEE9ac/tM0e4Bv1WLj2lyowIgMIOA4IO8nAodFJFUpoYq5plO08dwX/zlQAorv7wMBFI="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-2e4554a3d3a1265d058795c924d55d570dd46de2.tgz_1511361976493_0.9015502093825489"},"directories":{}},"2.0.0-beta2":{"name":"alfresco-js-api","version":"2.0.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2e4554a3d3a1265d058795c924d55d570dd46de2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-beta2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-nok5bAJuRmtEeq28kEICFolsD0UM2UiYgJ4GNPD9hrvXxXlLbHfsi1Ik//lg3abk+AwHt86lh4JvmZ3tkWW5Lg==","shasum":"4c8cecb45d267eeb118e34f5b1ffa66b3e5db08c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-beta2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3vHSaIXlswJ/ljJfjyAm7xVIYCQt5bPCEshGa/6VVSwIgHCWttPjqxOIH0A2g3sgMsE/dq3DyaTAp5izbkk6J6P8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-beta2.tgz_1511535661512_0.35220131021924317"},"directories":{}},"2.0.0-6a3be5a507ee0d34968b4cd633c5e2e0ee3cb8d1":{"name":"alfresco-js-api","version":"2.0.0-6a3be5a507ee0d34968b4cd633c5e2e0ee3cb8d1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"6a3be5a507ee0d34968b4cd633c5e2e0ee3cb8d1","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-6a3be5a507ee0d34968b4cd633c5e2e0ee3cb8d1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-UrqZplW0Qx7ZAAseuw49qT31vEUHBmDtE43sD/AwjFC1sWYUQIBfsxBUBKXTESAKIDgdNgd711WYe/hj5+cAfA==","shasum":"bfb2c4f9f67ec9632b05eb5b106e815d415b3f78","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-6a3be5a507ee0d34968b4cd633c5e2e0ee3cb8d1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzIAR0orlSWsLmWGPNmtsfzOnNe2nfl5qs+gxCntcN5gIhAIkReQG1u2Tltme/yky4n2P9dNhJKbOvN6jxzEkPST6d"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-6a3be5a507ee0d34968b4cd633c5e2e0ee3cb8d1.tgz_1511947154820_0.1732115859631449"},"directories":{}},"2.0.0-b8ce520e2ee79208f9076efc488a7dc353c2a715":{"name":"alfresco-js-api","version":"2.0.0-b8ce520e2ee79208f9076efc488a7dc353c2a715","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"b8ce520e2ee79208f9076efc488a7dc353c2a715","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-b8ce520e2ee79208f9076efc488a7dc353c2a715","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-P/WUpP2jjKGNNPWV6A3P+dAlq/H/1gGSnQ6KH1zA97qhu/JR47fkM2T/0E4THfqLNXtzrF9ry3F4C6HhK61pxA==","shasum":"9e55bdf8c8758ac18884ec3d3d57e9c41672344f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-b8ce520e2ee79208f9076efc488a7dc353c2a715.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB8jEkMaPJurZN2u/SOHU5peETQh4n6EW50miXX3cbRtAiEA4mfATToMBYNiCa5N3V0bZt5qOB8r8iaLz50wmjs9ttU="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-b8ce520e2ee79208f9076efc488a7dc353c2a715.tgz_1511948451190_0.8344251492526382"},"directories":{}},"2.0.0-852ca5d739decd5296ae8801ed0afc24b7ea7045":{"name":"alfresco-js-api","version":"2.0.0-852ca5d739decd5296ae8801ed0afc24b7ea7045","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"852ca5d739decd5296ae8801ed0afc24b7ea7045","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0-852ca5d739decd5296ae8801ed0afc24b7ea7045","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-fhUMoZ/3TIduBgauXvVlR5WSYZhPvz+0w8Vn/BWZ/LQ3kcH+QbzfWi474OkJTrdPBAN30NOfXxWHI/dMQDulYg==","shasum":"5c5f091d014633de2a53d726cc233f9a6cbc9339","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0-852ca5d739decd5296ae8801ed0afc24b7ea7045.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6GA4blcu3TmqaYwyMvIzN/HswYqrt9lBFGD/4ChhTcgIhAM4o4KbPqHy/4PWMgqkahElc+3nPpctc4MHSXUKa3gQN"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0-852ca5d739decd5296ae8801ed0afc24b7ea7045.tgz_1511966600361_0.22691510524600744"},"directories":{}},"2.0.0":{"name":"alfresco-js-api","version":"2.0.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.4.1","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"787fdda08a660cad2eed81984291a33590ce9f3e","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-BQgHq10PCFBcRwCyqUp4GuvUh/acJxKc2GF59mT7uQ7xEPwDH0mkmXotFjuUVw1qAJYQVn/3YxO0ezxa6ph31A==","shasum":"a019b01d48200c36f8a0ea229c416260365eed49","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGNy3mIMvD0QYKb+zAWcUlbs6qnL0o7erth1Pq0/59h/AiBdbReHUE7oaXJwCCjqJc+VDkx9SenkWcXEniaeRrbnOw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.0.0.tgz_1511971874981_0.30598279368132353"},"directories":{}},"3.0.0-beta1":{"name":"alfresco-js-api","version":"3.0.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"852ca5d739decd5296ae8801ed0afc24b7ea7045","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-beta1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6HLhB8DB1WjE4qr2IRmBKpPyWoyINuz83IWByRDuHT819iWqwOuA0elh+ej/HhspnWQlFzXipXghjdGMIwhWAw==","shasum":"5d278d578cb73cd47e47869b530d024e07e905da","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-beta1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDIfWs9GB/meUUTAtBgEkEhX58jD9tz9DgGJgP4w7B0hAiBSffPXxBIdfi5YQKAvopyJl8VFExVQk5itNZr64JOSAA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-3.0.0-beta1.tgz_1512141248651_0.8171953319106251"},"directories":{}},"3.0.0-beta2":{"name":"alfresco-js-api","version":"3.0.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"852ca5d739decd5296ae8801ed0afc24b7ea7045","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-beta2","_npmVersion":"5.5.1","_nodeVersion":"8.9.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-w53Fohnpm0o92CUMyMUY/wFbw1uLNXnxMW1+kX/LXjuVq+Cmn14Vt2q7P+ggWRry0FwNuvN25BIZq5DL/cG/gA==","shasum":"4a5ddab7dbbc82a4d5c7089901d1c44907d88d53","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-beta2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHjZ00df9iJmlTmx+2GNSZhM1GBQdHcslFopIFBVWEi9AiEAsU87t87B9xsaCuY30Cs+fbVa980qj6otb617kTCPnRE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-3.0.0-beta2.tgz_1512745268033_0.7931026525329798"},"directories":{}},"3.0.0-beta3":{"name":"alfresco-js-api","version":"3.0.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.7.0","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"852ca5d739decd5296ae8801ed0afc24b7ea7045","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-beta3","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-jng0Jookv2m28HZ/IPjpa1CTm58szgYKINXLeOtTMGgnmc3QQVt9tKoYeBTaQTwrcHg0I8cujArHPhLNzyjioA==","shasum":"f2aa582bb349783f6555834c63614b39ea2d9da9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-beta3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBvyEg9TG0H/crV1yvg0NRvRQdCq5YAOv2xflNd4UReAiAeoNBhpc/Lj6WPwJR/xIcIlLCFC3SIisTm+P+X62Ip7A=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-3.0.0-beta3.tgz_1513350066463_0.2552055618725717"},"directories":{}},"3.0.0-be1961c891dd0be4fdb4728385d0f2278580fa33":{"name":"alfresco-js-api","version":"3.0.0-be1961c891dd0be4fdb4728385d0f2278580fa33","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"be1961c891dd0be4fdb4728385d0f2278580fa33","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-be1961c891dd0be4fdb4728385d0f2278580fa33","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-vLfR6aOZd6RW3hyU6a5sTV19gIrAehaNT6PJ6iMWLXXlNapCww6UNGAg3Fd5KjZsQ3x47rrWtiQgiLssoUrrtg==","shasum":"1c0c4148054add65502b9b39868e0bf23f102e0c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-be1961c891dd0be4fdb4728385d0f2278580fa33.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDimfW8+Hu/EuC2lgHVZcny4H680TwelERXKE1YFZ40fgIhAJzlpSmfybRizu/8g08twBB0hnBiKeoDcOojqbCKt2n9"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-3.0.0-be1961c891dd0be4fdb4728385d0f2278580fa33.tgz_1513676443654_0.46076764445751905"},"directories":{}},"3.0.0-93065de6d2ea86156a6599824785950036b7a7eb":{"name":"alfresco-js-api","version":"3.0.0-93065de6d2ea86156a6599824785950036b7a7eb","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"93065de6d2ea86156a6599824785950036b7a7eb","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-93065de6d2ea86156a6599824785950036b7a7eb","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-LPCZ16Kj5VN4NEUetJp4ns8RuxPEpvGm7JtbRPLiDE1iPP1WFUCsSW5ZRCb/NS85PWXgJ0fDxNUqXkah9gnS+A==","shasum":"6080ae01996abc3b251f7910abe2c174ae3f0aac","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-93065de6d2ea86156a6599824785950036b7a7eb.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEY+TMwrdMO6PY1ez5Fx1IvK1tpoip7AZ0XLImX8Y3RTAiBT2N/+5sHnd44fiwXGXK4N00Y8xig098k/eyzXkpxIVw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-3.0.0-93065de6d2ea86156a6599824785950036b7a7eb.tgz_1513696044145_0.30643091490492225"},"directories":{}},"3.0.0-beta4":{"name":"alfresco-js-api","version":"3.0.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"93065de6d2ea86156a6599824785950036b7a7eb","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-beta4","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-+qFXEJDtz82PTiIo4rVgk2LLbU9O/ClZk920Cr479Jicidr+QoPFB8a1LdlvhakF3eM3HkrLGm/iJ+Kz3n+QTQ==","shasum":"2b10b46bf09bb09a467b27218ed7fa923390bd8c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-beta4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5V72I+pn5yyBucXJlAL/4qh+N9Tp2g8NoGCkVazbT4gIhAIJXUOExKYlppriKH7Z5mXbSQzlEfckc2d1LZSvP4DtW"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-3.0.0-beta4.tgz_1513954876892_0.8994085527956486"},"directories":{}},"3.0.0-beta5":{"name":"alfresco-js-api","version":"3.0.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"93065de6d2ea86156a6599824785950036b7a7eb","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-beta5","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ydYmLz+laycwVsGccCCOlThYTpD108t8fkDJ7GBmkKKn18OYJCojmCCOWqHsr6J3C77yVqiurUhAZt5DvtsHyA==","shasum":"d249e40f5b2268fc0af474ad1e9d3757599a34a6","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-beta5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7FdCp6PPZGPqzRFijJ2g4hgkCHVEXgTMveiLxwAn7uQIhAN+Yvr9LDCUF0RKRMk5PpCzrmo41LYLgw4iopqrGLnYo"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-3.0.0-beta5.tgz_1514560453475_0.49141586991027"},"directories":{}},"2.1.0-beta1":{"name":"alfresco-js-api","version":"2.1.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"93065de6d2ea86156a6599824785950036b7a7eb","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-beta1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-SkORoI9KfOfFWIs4hJdwa40QYizzbXQQOUCLojS62PXIH08iwOFPgw2BdxRCUvJfG3Kpg3+sKIdnoM4ecidMYw==","shasum":"7c7a07a108dce7eb771166eac57fc0e2b77e4b79","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-beta1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATmW1I3U0K/FKn/SIzW4+Ijke+eq4FU0Ifl9l7OTHUhAiBDtnzix2yROGtF+USMmYrPW1VAwN+sws0tjMr8i/rqQA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-beta1.tgz_1515164475477_0.9795288473833352"},"directories":{}},"2.1.0-5f3ac36ee721d7311a2c10b6dec456109bf7f0aa":{"name":"alfresco-js-api","version":"2.1.0-5f3ac36ee721d7311a2c10b6dec456109bf7f0aa","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"5f3ac36ee721d7311a2c10b6dec456109bf7f0aa","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-5f3ac36ee721d7311a2c10b6dec456109bf7f0aa","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-LK5z/CU5kOwYuUwR8cpc9Ibn3U58DVGZYIU6OCcqL/EPceKWRfn6SyIKiGL4Pxd02wTk7iAZZ0AoTfeAeyaSCQ==","shasum":"aa1a839b662b7a605f1054982d97b99935db6229","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-5f3ac36ee721d7311a2c10b6dec456109bf7f0aa.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLSshZAB0Sn54nkMrNSMaaktIPHVuz0Z1WUZuD5nb3MQIhAOGl2xYDNlh8rHBfTHiChbSF5duMlw8mhaipPAbYfkiT"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-5f3ac36ee721d7311a2c10b6dec456109bf7f0aa.tgz_1515602452777_0.14459521602839231"},"directories":{}},"2.1.0-d231c7a11e7076e3ad9bf1c32aa1b118f3d889a9":{"name":"alfresco-js-api","version":"2.1.0-d231c7a11e7076e3ad9bf1c32aa1b118f3d889a9","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"d231c7a11e7076e3ad9bf1c32aa1b118f3d889a9","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-d231c7a11e7076e3ad9bf1c32aa1b118f3d889a9","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-vOC1n/aAhplCaNJljoI8Yu1Ggzbyxkfn1MT1Ej/0LvJkujN1X28Ois9G1nvpCRmVPsxXC3yW46m0PXlOJXhgCA==","shasum":"3b9ef4e15378685dc678deed894789efda405948","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-d231c7a11e7076e3ad9bf1c32aa1b118f3d889a9.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDd6oyDtynV0y/mHBkKdVXna6wcp9NRXZ5yzOTq64eUCgIhALdJbeGqUWBo4gi3W3KOzl8CmswY+sDyAyHtqQ4p76g9"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-d231c7a11e7076e3ad9bf1c32aa1b118f3d889a9.tgz_1515750585340_0.2743052961304784"},"directories":{}},"2.1.0-0751c5e66735358ac650a9b37270d2a992c658f0":{"name":"alfresco-js-api","version":"2.1.0-0751c5e66735358ac650a9b37270d2a992c658f0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0751c5e66735358ac650a9b37270d2a992c658f0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-0751c5e66735358ac650a9b37270d2a992c658f0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-gOWr6c+8aE8deaSRa7gALV724uYaQoCniUFHvhvp6ziPF8rLz6b4P30e5bGcmbSxM9uimwm8Q4TmS5Ma+tBgQQ==","shasum":"bd450f08c300922fbfea8218e79ddebb2a7193f0","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-0751c5e66735358ac650a9b37270d2a992c658f0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBltPtnItFqQeJmBvB4IMsQKUx8gCF28NDk9bA3aZ/QAiBW82gvV/OsJhEksTi0BQf/Ny4yqcLro+BVLFKPu59+XQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-0751c5e66735358ac650a9b37270d2a992c658f0.tgz_1515763728646_0.7930970371235162"},"directories":{}},"2.1.0-beta2":{"name":"alfresco-js-api","version":"2.1.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0751c5e66735358ac650a9b37270d2a992c658f0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-beta2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-9pZTlL7yJvf/5jtZ7YmFs3o1XH/ss0IIhsYYwLhSUVGqnIe3YtQEHq7yaFwfhDed3jSoxPFQOdbHcFLWyoiqZA==","shasum":"23994e2490faf115e68aae07fbb6be63b5732266","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-beta2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQTWHlcK8SIi9+gKwjeh80j4mxoD9ujaNpnODkHLHXmAIgHPSfUYNwOnWUiPZRjeZz2FThmwFeDnLGfOFv690G61M="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-beta2.tgz_1515769295625_0.36233929521404207"},"directories":{}},"2.1.0-beta3":{"name":"alfresco-js-api","version":"2.1.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0751c5e66735358ac650a9b37270d2a992c658f0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-beta3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Usk42iHRqvvXX9Zw48csU+m2XFErE5+RbA3ppbWr10s+BI9zQJTLNnaU35fGLVtmbUF3TrTHsPxW8Z49b2g3oA==","shasum":"585144dcc9f24b84a59029b3c763c2160aa5e1e9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-beta3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvpKJWc+VEjDCn1gpTDVL4CQbEBfku9OJ8GvjgPC39+wIgHaUO8yBsccK0VeY4AU1oRTz6En+xdaFfndVVwbQLwNw="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-beta3.tgz_1516374093433_0.5559409908019006"},"directories":{}},"2.1.0-2bdd98ac8f7774a7681b4681fb7e5f9310d02d9c":{"name":"alfresco-js-api","version":"2.1.0-2bdd98ac8f7774a7681b4681fb7e5f9310d02d9c","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"2bdd98ac8f7774a7681b4681fb7e5f9310d02d9c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-2bdd98ac8f7774a7681b4681fb7e5f9310d02d9c","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-KOTNWl3AWQMbSetPlP1lrJqvNi3ACWKTvRfd8Q/aCNs4eUGFkADj04qTPgeuc1zzZEcSReZ3KXD/yfHa4Sn8TA==","shasum":"e6e1ca6954b4069ede37beb5b69f947d7cfd44ec","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-2bdd98ac8f7774a7681b4681fb7e5f9310d02d9c.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHVcK2bcTDIyvGfU2bXzeec4+N5zXWaEAqP0sp0DTj17AiEApAU2jN1oHzTUajorFFoX56YGglcBJ5/zVKW6Zq2uKH4="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-2bdd98ac8f7774a7681b4681fb7e5f9310d02d9c.tgz_1516892683052_0.1489446461200714"},"directories":{}},"2.1.0-c9b30392b0fb19e24229772d415e97caa9eb1f7e":{"name":"alfresco-js-api","version":"2.1.0-c9b30392b0fb19e24229772d415e97caa9eb1f7e","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"c9b30392b0fb19e24229772d415e97caa9eb1f7e","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-c9b30392b0fb19e24229772d415e97caa9eb1f7e","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-YJ9yYU5x9GKrryEqnkBXbOrLUwzbSAfQx2i73C0+2V1LdkuRNWe1OHmujCqNbW5Oj+ZbG+6ntGVn3+4QzAR0Mg==","shasum":"b3119bda9806c9a00c08285aab35329ffaf90060","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-c9b30392b0fb19e24229772d415e97caa9eb1f7e.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkGMJXdBtRBh76cossqEcU/iLFvACAm5lBrEj6VVgWJAIhAOHEozJnMOLYmYFirRVPhyctK/f6Y/zFxTsl6s39Tb88"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-c9b30392b0fb19e24229772d415e97caa9eb1f7e.tgz_1516962270874_0.020424034213647246"},"directories":{}},"2.1.0-4c702fe0041642c09f12fb939014cf70671d8ed8":{"name":"alfresco-js-api","version":"2.1.0-4c702fe0041642c09f12fb939014cf70671d8ed8","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"4c702fe0041642c09f12fb939014cf70671d8ed8","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-4c702fe0041642c09f12fb939014cf70671d8ed8","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Di8nhuvUcUNMPA03RxaIhOxsN9rYwPEPQhhLE+iXBG1kiF91EpKpfkaQAo28gOBXalTnA1Rh8B0MI5mEethWCw==","shasum":"1d9add0f5d80ff98ec9d24bc719cd489eb048ff5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-4c702fe0041642c09f12fb939014cf70671d8ed8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEID9A/AdR9bWyHqNViOdN6RP9hHuAeIVQ13RWlnIFXmAiEA23Aa8tXBYZU2t0yheOjMaMLpZ1rVZnANW5R/jTXrlV8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-4c702fe0041642c09f12fb939014cf70671d8ed8.tgz_1516964493562_0.1061799586750567"},"directories":{}},"2.1.0-beta4":{"name":"alfresco-js-api","version":"2.1.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"4c702fe0041642c09f12fb939014cf70671d8ed8","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0-beta4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-gXQb+I1HrcY8n+yWxy2f7glro0xwyei78j/4uCZkQletbBsNF0AEuIfePebbhMUgJ42qS6BlJcEa3U9zeioddQ==","shasum":"be79951d6f4f2a27053e41c1afb6bef37d611570","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0-beta4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBcr6ihQ1HkgVoeZdaYGS/0xNLjezeipDzOEhgixCxDAiEA0m/9MdpChl/7k39qSbMFn3WTDeFFFHlKtrkKNTNl7vI="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0-beta4.tgz_1516978894819_0.3910045064985752"},"directories":{}},"2.1.0":{"name":"alfresco-js-api","version":"2.1.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"17a6e0d65df085bcaa963f0dc7c1edbac289e155","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ijiP0NEDHjvp5ZLwAhz8D9tLhx/ZxvRnSpqNPyXi1xAMEplCFGDbf300MVz5RmhEHzt0352I5kD3W7JmrTmgdg==","shasum":"1754c332de254bc58dbaa98b63a85f1c880edfaf","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAxJvNxlk7N4DnzblON/w8w26Dv3dt0eEdJFm2jEkLvXAiEA+m6yqejA+swBI7h+V6gqIRWBFnnVXK+AXrVCfcWwWlI="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.1.0.tgz_1516985109915_0.998035637428984"},"directories":{}},"2.2.0-beta1":{"name":"alfresco-js-api","version":"2.2.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"4c702fe0041642c09f12fb939014cf70671d8ed8","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-beta1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Jay71zhgBL2I8LO3D3e3zJqlAQFEl8go983I8rKM7QH0eiabQsbXDuvu4+4dlCwrpxLstmBKZFTOIsyfufrISw==","shasum":"3a380fcc437f51276b96d0a6dd1bf439622d68a6","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-beta1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOxMy4yJsJiwqqljG9lSpVetpOrKlIag3LawJ6iFGdgAIgUuwnq6aXwzqZ1rJCb3l2xTJUY770O2AFuUYa+BM5F40="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api-2.2.0-beta1.tgz_1517583703874_0.7245589909143746"},"directories":{}},"2.2.0-c3c28a1c6f84bd15bdabbf5928c97a3d355e6a33":{"name":"alfresco-js-api","version":"2.2.0-c3c28a1c6f84bd15bdabbf5928c97a3d355e6a33","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"c3c28a1c6f84bd15bdabbf5928c97a3d355e6a33","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-c3c28a1c6f84bd15bdabbf5928c97a3d355e6a33","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-kI3ASsLptZ5btbwmvYe89S3vSJkQBvu8H6TdLYdlk4cAvJ7UVVeysZxWcI+tiimtFx2RXTME7BPNCvAV/ERUkw==","shasum":"4a8e6c32566eb09272fc20e2eeb0f2f19d1bfc1d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-c3c28a1c6f84bd15bdabbf5928c97a3d355e6a33.tgz","fileCount":1139,"unpackedSize":8054425,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsPlSwLbxeY9lh94ckgsTbp0SQIKDoIeQpvqSECqg7vwIgSV8qBY1nsxfQzmIVy4hhshhSpQ/pWU8IpfkImbT8zRc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-c3c28a1c6f84bd15bdabbf5928c97a3d355e6a33_1518021465556_0.32630632572626483"},"_hasShrinkwrap":false},"2.2.0-beta2":{"name":"alfresco-js-api","version":"2.2.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"c3c28a1c6f84bd15bdabbf5928c97a3d355e6a33","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-beta2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-WzzMx3Y0tQVzCwLoW08juw1Y4oqMLXSR5Pki916Ll2+dRvl4MQt2wDSEYDirDv73JoU+5ebFlpD0/7qVAhXbiw==","shasum":"c39f4e095cd4021ac20a861460f80506052975ce","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-beta2.tgz","fileCount":1138,"unpackedSize":8054320,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4V51Rx0VI5iHekUPPijoFUxnGS9OKJYHOOUTVuLnttwIgPvVmDAIifyte87PuOl9pgaFb5zU7scsjKuWyq0VLLzk="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-beta2_1518188499619_0.8816388654893366"},"_hasShrinkwrap":false},"2.2.0-37ae1528b50160408e0ec1e3f16c9f938a8e97c6":{"name":"alfresco-js-api","version":"2.2.0-37ae1528b50160408e0ec1e3f16c9f938a8e97c6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"37ae1528b50160408e0ec1e3f16c9f938a8e97c6","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-37ae1528b50160408e0ec1e3f16c9f938a8e97c6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-eH4xmm+4qDFhF1c5aPHLK7jkF/C4KXgFLIWpaC/aB+HvO7LbNWE+krBCetnok8WRxHx1lfrE94k/K35ymutf8Q==","shasum":"bea54942e74364c291cc5750e080e8866566d13a","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-37ae1528b50160408e0ec1e3f16c9f938a8e97c6.tgz","fileCount":1139,"unpackedSize":8054441,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/o3uC8OtCu0YSa2AzD8y3b4C3if5VJTlvJ3bDZLwipAiBDMLWbVwrBz/KdG/DLgdo0OVRTVRkMR0BgN66LFjoYpQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-37ae1528b50160408e0ec1e3f16c9f938a8e97c6_1518443744192_0.4827170078954981"},"_hasShrinkwrap":false},"2.2.0-317d2ac38504393b8200e4fe7dced98eb5725b2a":{"name":"alfresco-js-api","version":"2.2.0-317d2ac38504393b8200e4fe7dced98eb5725b2a","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"317d2ac38504393b8200e4fe7dced98eb5725b2a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-317d2ac38504393b8200e4fe7dced98eb5725b2a","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-sH7wlhzYt6Xfweu6tGhQVeOX0870vXY+u+9Jz7+AsFNArMKPmroM4vyl2vDIGfWIrQSDhOeLemxtB52zox8T1Q==","shasum":"a7600e50c1af52cd1ef1c97d33a88ace7573faa0","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-317d2ac38504393b8200e4fe7dced98eb5725b2a.tgz","fileCount":1139,"unpackedSize":8054425,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaBnW2hSp98BIFxdCj/VER2hXRS9lnchhBMJYs/G0z0gIgDjukYZTL6qIFwTkfGgP2pKSgqHkPocYa+BeVNtJOi4E="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-317d2ac38504393b8200e4fe7dced98eb5725b2a_1518445357936_0.2845730319116899"},"_hasShrinkwrap":false},"2.2.0-c8f6736c571c52038c46b490892f96616b31662c":{"name":"alfresco-js-api","version":"2.2.0-c8f6736c571c52038c46b490892f96616b31662c","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"c8f6736c571c52038c46b490892f96616b31662c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-c8f6736c571c52038c46b490892f96616b31662c","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-zq4e230d6RZyWvOvDJT1+l0uhwC3xj0DEJu+5lCS5UkZkCDktVguRxxhhlwuq/RWXrRprUSVYCtgI2zcSNdWag==","shasum":"0f395db73ff2d2b41e5c24617e9defa8c52760f5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-c8f6736c571c52038c46b490892f96616b31662c.tgz","fileCount":1139,"unpackedSize":8054385,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQfYjAFqX1xfipTMT52dhZUYwGU3xsKI+WxzjUrC2SBwIgIlufg5vYERd3dNGsbU092wv8kv53Q3l2jCXFbbE4FyE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-c8f6736c571c52038c46b490892f96616b31662c_1518513941907_0.44862729762690456"},"_hasShrinkwrap":false},"2.2.0-beta3":{"name":"alfresco-js-api","version":"2.2.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","browser":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"16ae4ddfa72fd7ca665947699de5fdc02b0c0cfe","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-beta3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-LRI8SezrvsJt+fIU5w5OHzyZ8fI2FmLLM9aq+rvQ9cXOr1DExvAu2T8Tg1a4AYdZESP8JvZXNx1ZvmBVnW1T5A==","shasum":"1bdc0a6df4482b5470553eef4743a1615f9da11d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-beta3.tgz","fileCount":1138,"unpackedSize":8054496,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/KGhwsNImS397ZJx/jS80cmLvDY835orNFppTI8SuPAIgOj6kPG5OfRAwCB+OeeH7IFBChY7uv5UXS02LERwYPaQ="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-beta3_1518793303863_0.6209083933442097"},"_hasShrinkwrap":false},"2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f650":{"name":"alfresco-js-api","version":"2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f650","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"8a2c1fb6ee2bda69d7fba46f9498586e81a3f650","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f650","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-pJgHpAfrviZxMMQQMGF2OwPz3VE9tw/wqjKlq2xQDFo1O488lA1E6DSgcx8MxRY1uGgolwFS2HgptV/scxy/iQ==","shasum":"0dc1de99d586439e38e687502753e2e28c6c5ad9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f650.tgz","fileCount":1139,"unpackedSize":8059783,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8cDPIrE3Q/t6INDMxuH2DLlI1nvK274ticdZaH8DEIgIhAKSpd02n5oNPnCRvMA61GKaDaZPeDwXh8c/Y6mKwFWnX"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f650_1519380795022_0.7776397934484338"},"_hasShrinkwrap":false},"2.2.0-beta4":{"name":"alfresco-js-api","version":"2.2.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"8a2c1fb6ee2bda69d7fba46f9498586e81a3f650","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-beta4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ykKB+jQmYzXY20qrqcXVCpwZLLH0AzpfaMiUThjjKTFjO2rj7hTNJb+CqOY9gtIY5ty2LClsfaumY2npUuUtKw==","shasum":"60f78f0670872c8244a13ceb1f13340c830adb0d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-beta4.tgz","fileCount":1138,"unpackedSize":8059678,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCorV/W9zUBxkX/H2dXhcxchJe1pmqfFLTpt5h1hlGHnAIgZXocPhOGQGcyR4BqthqNqzveW77gRaA2oF5uk+g/A+Q="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-beta4_1519398099363_0.9043789118646537"},"_hasShrinkwrap":false},"2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f651":{"name":"alfresco-js-api","version":"2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f651","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"25ecdeaa23c90d227112cd145cf3d1ccf1d2497d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f651","_npmVersion":"5.5.1","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-lyCrTu/zcpKqI4YDNNIXM5QUAAio9uCesHmaFEY3YY3cOdc4uF6v+hqZ1g0bRKooRM89A/dOcjl0Nc5HEHgHsw==","shasum":"8bd3272b2954a6acdcba5328fd20fa9593d7381e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f651.tgz","fileCount":1141,"unpackedSize":8061615,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG3cMhuUGkVVzBcl84pws4BaarVVK0lKqS3XKoZDuzhpAiBXf1DOn1Eop0De7G+UBDg1Yg48tBGtBNOg9FIpc9UImg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f651_1519426478987_0.5094898241585497"},"_hasShrinkwrap":false},"2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f652":{"name":"alfresco-js-api","version":"2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f652","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"main.js","module":"main.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"25ecdeaa23c90d227112cd145cf3d1ccf1d2497d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f652","_npmVersion":"5.5.1","_nodeVersion":"8.5.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-jYUUrzmTFgBJLfH2dVz/F386JDdV9L9Vms9n/jAV6s1gbxg6g8eIt3ThAr8P60lVNsW4zKSkPd3bGVyMHojrDQ==","shasum":"b6fd32ac4468b183cd053a8c9f2fd3f245e3c440","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f652.tgz","fileCount":1141,"unpackedSize":8061599,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD05dzIk24sArwkXy1Cq2S85mgZDN3S3gQsJP0CN6VFsQIgVr0ZUV0gSNQ4LgCL0KjxUEfltE4WSgSS5Q+3njTUjA0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f652_1519426697337_0.6831351609285639"},"_hasShrinkwrap":false},"2.2.0-4ca81f81cddf377b12b6ff94f0c62af68ab907d1":{"name":"alfresco-js-api","version":"2.2.0-4ca81f81cddf377b12b6ff94f0c62af68ab907d1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use this component check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\nnpm install --save alfresco-js-api\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"4ca81f81cddf377b12b6ff94f0c62af68ab907d1","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-4ca81f81cddf377b12b6ff94f0c62af68ab907d1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6zQwtLZXiQeGD5of9Q3hU+LD5w8b3XyoR8kW++AzjdEuBDKirnEXtwn0hcQRMwlAv67E3JQLcW4duWhFLdqQRw==","shasum":"6d0de4f240a0936decb81967885b3c1f94165279","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-4ca81f81cddf377b12b6ff94f0c62af68ab907d1.tgz","fileCount":1141,"unpackedSize":8062589,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbV0JaxFTi3jiZW8a/FC6EHzVmIlTH/r7qj5acd5BnTAiEA3ItYDmL+59Er/dZIqP+6FIaIjShaTFIEblwHrF3GPD8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-4ca81f81cddf377b12b6ff94f0c62af68ab907d1_1519836411558_0.9660604407064015"},"_hasShrinkwrap":false},"2.2.0-2562e73970a92cf7b886006c8b545edde98d8d7b":{"name":"alfresco-js-api","version":"2.2.0-2562e73970a92cf7b886006c8b545edde98d8d7b","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2562e73970a92cf7b886006c8b545edde98d8d7b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-2562e73970a92cf7b886006c8b545edde98d8d7b","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-fdkd/Myq0axW7qFt1jzoezHmd0sZoPaus7Cf0QkA5fADE+7siMQFvWRYC8MmdNsdbC417OzHmC+79++B7XLu3g==","shasum":"37574377ef524e3978aee46c0a4eed90ff479fac","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-2562e73970a92cf7b886006c8b545edde98d8d7b.tgz","fileCount":1141,"unpackedSize":8062728,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDeQAqHtfEqEIrhFZd6Xxi47E8gfL6Ulz08Xejfz8YRLAiEAxiDVe6Aqnbf7tX5ZzOpt8dmSJz69CK/hQUJH9xdeO+Y="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-2562e73970a92cf7b886006c8b545edde98d8d7b_1519837123641_0.7494883322094359"},"_hasShrinkwrap":false},"2.2.0-2cda04d780f0317b8cd55a1b511ebb26e33c4152":{"name":"alfresco-js-api","version":"2.2.0-2cda04d780f0317b8cd55a1b511ebb26e33c4152","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2cda04d780f0317b8cd55a1b511ebb26e33c4152","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-2cda04d780f0317b8cd55a1b511ebb26e33c4152","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-NBR4vVeJtPX13Vgfe4AAqAd5KnVIa1+4uYzzdeRbEcR+WE+s0ixbYNQpWdp/P2q2fkIROOBy6lOOV3gc1ZH7uQ==","shasum":"27129182b6a3e19fae5fa22c91c7cab7fc2f8544","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-2cda04d780f0317b8cd55a1b511ebb26e33c4152.tgz","fileCount":1141,"unpackedSize":8062744,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAaeOl1G8I4mnODpnS8E3aXkh+tuCQrFP0KIKtUeA8fCAiEA4CaguAe/L6iZZcxrYLI32dSA4Q8mn8Q8hj+xFU+d7Dc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-2cda04d780f0317b8cd55a1b511ebb26e33c4152_1519837662764_0.4711117952986519"},"_hasShrinkwrap":false},"2.2.0-beta5":{"name":"alfresco-js-api","version":"2.2.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2cda04d780f0317b8cd55a1b511ebb26e33c4152","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-beta5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-koZais4EuAHNk59q0Xj0/w/8xQG+hGxcVDdxOBmsisdHQMIM2D18YIBCD4LCche1TtxjHKSZwsM1JKyIRNBmtA==","shasum":"1bcd935e9683bad75040fa350cb872103462a70c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-beta5.tgz","fileCount":1140,"unpackedSize":8062639,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWoiZML5gTbKPl7qzKI9sOEfUgvpB8YMPI2gq5bXj30AIhAMKRl269/+eo1NO6YRujKKpHCziFFG3/yFC0R4M9Aeud"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-beta5_1519837983410_0.5369520093127491"},"_hasShrinkwrap":false},"2.2.0-ba43bebde72331352731c7fc312737e6cf76efbf":{"name":"alfresco-js-api","version":"2.2.0-ba43bebde72331352731c7fc312737e6cf76efbf","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"ba43bebde72331352731c7fc312737e6cf76efbf","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-ba43bebde72331352731c7fc312737e6cf76efbf","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bWOXInMLLeFUbibV3rMDvBK9QknRaUMntXbOslYD1lwCE6nm1NyjarQtGC0HCpIyMcfl6PF1bJIOpvzZpfPRgw==","shasum":"1c4c7c6b8b487c406aa7aae9ff698f6196e03332","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-ba43bebde72331352731c7fc312737e6cf76efbf.tgz","fileCount":1141,"unpackedSize":8062765,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDenaB+9+ce75bK3CdBbZ4LO1K2iXQIpJCWzv9JXkRjdgIhAP286HPFOhgjttorK+30r0rljOw0IsxILnelrbBkDY48"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-ba43bebde72331352731c7fc312737e6cf76efbf_1519999848147_0.7816494057564818"},"_hasShrinkwrap":false},"2.2.0-beta6":{"name":"alfresco-js-api","version":"2.2.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"ba43bebde72331352731c7fc312737e6cf76efbf","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-beta6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-SgzQeQ7Eah0U6T3GvCIEx44SFtoFcm+w4oSiGJNpOeRhLML3ST1wlizNfG4YVr11+Qw8Ur4OZUsNMsWrqc61dA==","shasum":"e95fcdcd2ecd965fbf5c5492f6b92c96f0392635","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-beta6.tgz","fileCount":1140,"unpackedSize":8062660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8TjiQQB/UWVUF2944oZSeWclyJMe2PEkayQJSNmexiQIhALuyaJ+t/2RcCetrIAZwGmKH343v7FY2YC6g4gnrGTl9"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-beta6_1520002896937_0.5971099471565824"},"_hasShrinkwrap":false},"2.2.0-6d80227ed378f5ae1a55ee5c6bd885285f28bec5":{"name":"alfresco-js-api","version":"2.2.0-6d80227ed378f5ae1a55ee5c6bd885285f28bec5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6d80227ed378f5ae1a55ee5c6bd885285f28bec5","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-6d80227ed378f5ae1a55ee5c6bd885285f28bec5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-DlUO6XbXRcRBOZoi04I6rNvBVQpWxmT9/ldITdL8TlsyqvSOrUKYOn8F6G3UZX3jPUQ+V/AU6o2CrAbiZEAL7A==","shasum":"4a296f8cdceac7460120880ae824d42b3354d7df","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-6d80227ed378f5ae1a55ee5c6bd885285f28bec5.tgz","fileCount":1141,"unpackedSize":8062765,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHzHwE6N4BS0zxYqcNMU3DjOVOCb1gOeGe1Rd1zhlwHfAiAVNZ/MEe8JyJd8zjrCkwhB8QKjGwP45jIUv+yXnxoLcg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-6d80227ed378f5ae1a55ee5c6bd885285f28bec5_1520248785701_0.7139699805367552"},"_hasShrinkwrap":false},"2.2.0-69b54b2f564ed863f5a47355ea0371754fcbb84f":{"name":"alfresco-js-api","version":"2.2.0-69b54b2f564ed863f5a47355ea0371754fcbb84f","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"69b54b2f564ed863f5a47355ea0371754fcbb84f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0-69b54b2f564ed863f5a47355ea0371754fcbb84f","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-lMnfCuo9VSLVEE/AZNOYUZZxU7ZP0cp5PvpV+fDl+oyKENmxPTUjjQ//pLwTvEtls/WZNuqYFU6e5gQZiKoLXg==","shasum":"1d2ca6a2ca128b75069f3163e69fe1e756570b3c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0-69b54b2f564ed863f5a47355ea0371754fcbb84f.tgz","fileCount":1141,"unpackedSize":8062509,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkjmDP4V2AlNBgknni/S6yesMsgEor6RM1QoxiLGMDwQIhAMe0GpwG2PppNvrk6gYLTISpc+/nl6xPgqQlblLBpyYi"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0-69b54b2f564ed863f5a47355ea0371754fcbb84f_1520248947573_0.3161352598283371"},"_hasShrinkwrap":false},"2.2.0":{"name":"alfresco-js-api","version":"2.2.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"fe4b6320ca2bc1d48d271177053dd6d06d6df9bc","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-lskswsRQSulpn8xLC5znj41k0FxJ6KwYh8OuTBytoA47/dT65lmA6CXQAL6et7NKWLcwByfdY+2quDrCt3Dgwg==","shasum":"9a5bbe290e793c0074e2b369010f23509ecac904","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.2.0.tgz","fileCount":1140,"unpackedSize":8062328,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIElNOAz0gnA4ypHv1TjpzqZUyOJuZ6YwJ0tvmu62HyBhAiEAgToXp030u7R62DjwckqEAF+0s8zYokzyYrlqSh2pJ8Y="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.2.0_1520261493375_0.6603124774506037"},"_hasShrinkwrap":false},"2.3.0-beta1":{"name":"alfresco-js-api","version":"2.3.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"69b54b2f564ed863f5a47355ea0371754fcbb84f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-1bRguRJjsUBwSJcZyGW0hIjp6zPXoIxhhT8MqDiniwo0XCwITtDKM4ELUTVJZ8/xfkMQ0+/aEFVoOBv9d+GUxw==","shasum":"b629e163dac8abb0373716b1822740ffe274751b","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta1.tgz","fileCount":1140,"unpackedSize":8062334,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDAev+EAUsfRt7QK3g3Ml88fCW9u5c61pdQbqgjMtYCAAiALFklk0sZuv1OzOfkBUhDTlIJpVOSOeZlg4Yfr3WN5Zw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta1_1520607701595_0.004200745178373655"},"_hasShrinkwrap":false},"2.3.0-2b3e3f1fdae61cb0a4a6e7014969565a829f5fd4":{"name":"alfresco-js-api","version":"2.3.0-2b3e3f1fdae61cb0a4a6e7014969565a829f5fd4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2b3e3f1fdae61cb0a4a6e7014969565a829f5fd4","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-2b3e3f1fdae61cb0a4a6e7014969565a829f5fd4","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-TMC7n9/IrvIwcWNJY9CvZrmupdiYUM/qqXq8XYAefCOG9/74/koFIkfHizu5yYsFOE/YtSyeRtiaOIcxyoevMQ==","shasum":"0f5fe46268ff1824366febd076e8c90d7a98f6cc","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-2b3e3f1fdae61cb0a4a6e7014969565a829f5fd4.tgz","fileCount":1141,"unpackedSize":8062613,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICm4AqKLw/NS9HRQ6ltcn5outAp3vvOoD0mPrJ8i6xsBAiAWvVqVyFqWHDfzJonp8MB12034bY7qXjkGZ8QjZak7ZQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-2b3e3f1fdae61cb0a4a6e7014969565a829f5fd4_1520635245448_0.5160362949687931"},"_hasShrinkwrap":false},"2.3.0-bc739247d02401e9678943b98aa63de8cb85a274":{"name":"alfresco-js-api","version":"2.3.0-bc739247d02401e9678943b98aa63de8cb85a274","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"bc739247d02401e9678943b98aa63de8cb85a274","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-bc739247d02401e9678943b98aa63de8cb85a274","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-8E/0jFYyu9i908GeqjX2Q1iSVzlsheTBCMt9yggWqMIJ8etp9CdGUkOWo6LalCbBqtvlcqlHGC5IuzpA6tkNCg==","shasum":"06ce2dda140cab2fa171bbd7470527a2c6fab398","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-bc739247d02401e9678943b98aa63de8cb85a274.tgz","fileCount":1141,"unpackedSize":8063046,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFr69afq7H3Lsa18ca1G8+Je1qLipCd2TJ2KsKTYGfcLAiBfB97QDfT3mBawLxPBSVikCB++MT0EQisxDjsmAvhXJQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-bc739247d02401e9678943b98aa63de8cb85a274_1520872167565_0.6643576679983387"},"_hasShrinkwrap":false},"2.3.0-beta2":{"name":"alfresco-js-api","version":"2.3.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","watchify":"^3.7.0","webpack":"^2.2.1"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"bc739247d02401e9678943b98aa63de8cb85a274","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta2","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Mbeq9EjqyNo6NzigQ9AS5awu+7Bj0s6Ob2NxLKXJjvyc2v2T0/JAbVczyRsFn65zVFYXjEPiZxTwQWn9p+Ku1g==","shasum":"80a670b79cf4eea3f07672a0c3ea8be79b20ea10","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta2.tgz","fileCount":1140,"unpackedSize":8062941,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKtE4xn+RtftjRza4v6S1bdnDVS3W0mT3yxARXfGLzxwIhAPoMOPKTtnodfl4ggmaRlqg4covloNhip0ESeqA/H8hc"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta2_1521040511843_0.43011862273459167"},"_hasShrinkwrap":false},"2.3.0-efa7130dee02699999cfdb9e96ddba8763dcc1a8":{"name":"alfresco-js-api","version":"2.3.0-efa7130dee02699999cfdb9e96ddba8763dcc1a8","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack&& npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"efa7130dee02699999cfdb9e96ddba8763dcc1a8","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-efa7130dee02699999cfdb9e96ddba8763dcc1a8","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-V3EhloKwWaWvSneeiqY4osoEJhpHEkbgvAuT+E13EfYlxt4mfK4KjbhBBHDx/Jg++IjIRSQuNL6AdNknvOtsUw==","shasum":"c3228c77193f8b0ae389a188ecc5d1326a41e5ac","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-efa7130dee02699999cfdb9e96ddba8763dcc1a8.tgz","fileCount":1141,"unpackedSize":7724323,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFOzxe2tB71aejs9ygtNwSZbkvw3MBJR+wzjNw3XOt+nAiAghkNO5KZr2DzeMKItqAmDoOGpmoxddSkUOhvC0tx3sQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-efa7130dee02699999cfdb9e96ddba8763dcc1a8_1521051500123_0.8983307651442658"},"_hasShrinkwrap":false},"2.3.0-beta3":{"name":"alfresco-js-api","version":"2.3.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"24bfd3e92d2c967d0d3a88eb56844c1e8fab85a1","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta3","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-G0fjBhQPqlvP9hlgfKN5gw4Iyv7fygtdKAGaob7HSxLce7Mgnqgum8Dn0ZmWNy9QzQlqZ5dKggGHBhnfBZeO/w==","shasum":"3dcd36de365bed9cb9a497d0ccc26f0194d6fd7f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta3.tgz","fileCount":1140,"unpackedSize":7724219,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFxtH12XHOdflnFr8p60Na5c3O7Q5RM0TPQsTHPWC4wQIhAMRUoy+DlrW05IOUI3buevmBL6EH1iRVNhA2UQNt9U+S"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta3_1521107080418_0.3259429756903971"},"_hasShrinkwrap":false},"2.3.0-24bfd3e92d2c967d0d3a88eb56844c1e8fab85a1":{"name":"alfresco-js-api","version":"2.3.0-24bfd3e92d2c967d0d3a88eb56844c1e8fab85a1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"24bfd3e92d2c967d0d3a88eb56844c1e8fab85a1","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-24bfd3e92d2c967d0d3a88eb56844c1e8fab85a1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-p+8OB7RNRjRSETG5/h7iXDZC3yCOPFuCFIQiI2iKORKeeQuYtNWfld/yoiyU1AveITLYpmkZtBcuI9UeBUIiag==","shasum":"755f4a7dcbdde0724bac39f51d8d56e8c4393289","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-24bfd3e92d2c967d0d3a88eb56844c1e8fab85a1.tgz","fileCount":1141,"unpackedSize":7724324,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGjqMWCeei8Ld+b/PRvfihM98homuNhQMD0LKGt8aTT8AiEAz3V7TFVsr9xZwQMKY5nLxLMpLwR2sY75XDl9dH3C13o="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-24bfd3e92d2c967d0d3a88eb56844c1e8fab85a1_1521107117812_0.10714770468726154"},"_hasShrinkwrap":false},"2.3.0-87e54382678b6548e07e1e5664d332f20e77d4bd":{"name":"alfresco-js-api","version":"2.3.0-87e54382678b6548e07e1e5664d332f20e77d4bd","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json -d out","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"87e54382678b6548e07e1e5664d332f20e77d4bd","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-87e54382678b6548e07e1e5664d332f20e77d4bd","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-r2E3oyz+SdZX4/HPByECD0if7Thop9iFp2ZbOqcxnIuqL3j9I7s/dnF1BWuIxsRsWGmCzc1O2SfTlIfGpiQOfQ==","shasum":"612da91560a0042ed27132dd5081a8d163accf31","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-87e54382678b6548e07e1e5664d332f20e77d4bd.tgz","fileCount":1141,"unpackedSize":7724074,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH8iyHvhOxPi10tPrFIyAfC6GqK9LVdejswioierUwiQAiEA/LoytQ7YTYVvnR7yrCmXR5SamOkkLjiEg1caVYYvN2s="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-87e54382678b6548e07e1e5664d332f20e77d4bd_1521108197156_0.7816877753898206"},"_hasShrinkwrap":false},"2.3.0-bfa4aad6c978c31509336a0a78eb1ec36e8c6862":{"name":"alfresco-js-api","version":"2.3.0-bfa4aad6c978c31509336a0a78eb1ec36e8c6862","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"bfa4aad6c978c31509336a0a78eb1ec36e8c6862","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-bfa4aad6c978c31509336a0a78eb1ec36e8c6862","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6NlQHBkNReKB5WNhY7Sz21qhByBGibLDLLVpoV72JhD1tJFq8NU1zBrnAcFhyt1DVvwMtqR7Iwn1tj8T8LYjwQ==","shasum":"f846c394080e171586c71626a247ed7bfb7fff25","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-bfa4aad6c978c31509336a0a78eb1ec36e8c6862.tgz","fileCount":1164,"unpackedSize":7849041,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEkp0DfrZ592iBDav0PlsTS1nygJSI8MSrifsZFXT57gIhAJM21mh2k1GqtFGns6YNn9QmAUHixB1dsBuhqZDTEFcn"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-bfa4aad6c978c31509336a0a78eb1ec36e8c6862_1521143663315_0.35452610119916983"},"_hasShrinkwrap":false},"2.3.0-beta4":{"name":"alfresco-js-api","version":"2.3.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"bfa4aad6c978c31509336a0a78eb1ec36e8c6862","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta4","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ZOfiNaTO70B1wKgLOOag62fjDGJmdgv2jcAOkXctSrH2Tl98Dsha5xNk2/Egx35QilAph9R7U/gqjRpyrMmQ7Q==","shasum":"0a9ca7a93ee491c16b2a346669bdf90c8957fb62","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta4.tgz","fileCount":1163,"unpackedSize":7848936,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6xt7eYZl2UtFjZ5Y1HLOkxKKIeE0Nrk3QFyfWOz9jNAiEA9EnK5pLgyK7QXla3mRsTYjZsGXQMXoV8gPe8iyiJD+U="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta4_1521212559334_0.06258694303413037"},"_hasShrinkwrap":false},"2.3.0-7186e9787152f396d8c6c6dc191578ac486a1986":{"name":"alfresco-js-api","version":"2.3.0-7186e9787152f396d8c6c6dc191578ac486a1986","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"7186e9787152f396d8c6c6dc191578ac486a1986","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-7186e9787152f396d8c6c6dc191578ac486a1986","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Qqejfdl5GXC09PSTGrCwwwVXYr8bZ+rHS1J/LulwvcpsU/6nnR+8Y/mJle3zTq+5ltnRwSlQ0aCBq5PMd5DR/g==","shasum":"da8b4039cf6218d9f399a7e61d5e23c9d7f33969","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-7186e9787152f396d8c6c6dc191578ac486a1986.tgz","fileCount":1164,"unpackedSize":7849338,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAnRMDcJE1kzA8G0RDohTo3tC0Y33UHCpzmcjfIbfWoMAiEAq0/QRE/e1HayfuEQB0HFE6BBlNu3YQYdH2w0RtHm1Ys="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-7186e9787152f396d8c6c6dc191578ac486a1986_1521575593404_0.32337934368602883"},"_hasShrinkwrap":false},"2.3.0-beta5":{"name":"alfresco-js-api","version":"2.3.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"7186e9787152f396d8c6c6dc191578ac486a1986","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta5","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-hIqGv7/EWsHC3GP7z6JXCA5ZENB0LMbSys3Ra42r3ytrtwPVO3un5spvXGrc64IX6DXJ/xofRTBmO9awOapNeA==","shasum":"6a63d7c179cf7f0c5f1d4a928d68aa5468bffaf2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta5.tgz","fileCount":1163,"unpackedSize":7849233,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv38IytyBfsOFYos0WFfZAhkkkM8WsQ0+xadFhLYabFwIhAPuqOk1/uzfXyd3KHedh9BFGS4OH9HgpmlBUMYtWyNcH"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta5_1521817378624_0.6925556220211369"},"_hasShrinkwrap":false},"2.3.0-8f92fd282c67dc4ba5344a0ef7279fb1d5ef0c9f":{"name":"alfresco-js-api","version":"2.3.0-8f92fd282c67dc4ba5344a0ef7279fb1d5ef0c9f","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"8f92fd282c67dc4ba5344a0ef7279fb1d5ef0c9f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-8f92fd282c67dc4ba5344a0ef7279fb1d5ef0c9f","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-E9sDbnTxIpHc3HC2x2fWgqmIdQ0MUsD2GwsKih99fK6DMRqUl/bTfWq/o/cc/E3oigr7o2ga8GKgcGGsMMpvEg==","shasum":"5da51839f081c3cebf2e01264cb1851eaf7f94b7","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-8f92fd282c67dc4ba5344a0ef7279fb1d5ef0c9f.tgz","fileCount":1175,"unpackedSize":7967730,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1M+Pd4qE5KldrmIjGWSs22Yjj0ehgAzihkrXST55ikAIgbbx9/q8fe2sXqeyn/AyxTPKdzlJzN2RLqm/xh2j0GJs="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-8f92fd282c67dc4ba5344a0ef7279fb1d5ef0c9f_1522143143342_0.9425268492191545"},"_hasShrinkwrap":false},"2.3.0-a8fd3e442a61ccdeb94e562cb9d5e305341b2368":{"name":"alfresco-js-api","version":"2.3.0-a8fd3e442a61ccdeb94e562cb9d5e305341b2368","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"a8fd3e442a61ccdeb94e562cb9d5e305341b2368","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-a8fd3e442a61ccdeb94e562cb9d5e305341b2368","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-xTvOwCaugndH1rNFZOZhGr39WzHjri1Aho+U2VGorrbJ8QGNXjG4SGcV9Q8VPtuugqT47emAdFY0Nbl8HOY8Kg==","shasum":"aa22b30c32883a6eb6d16d866beec4302c81f7ae","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-a8fd3e442a61ccdeb94e562cb9d5e305341b2368.tgz","fileCount":1176,"unpackedSize":7999004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6lLKtYnhHtWCS4PV7TDOQwO/+fCfYVfJNvrs5VguOHQIgAb06N9ezPsUQ3MGA2uIRxlrQbRuiMXD9MhmSgrZAYdk="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-a8fd3e442a61ccdeb94e562cb9d5e305341b2368_1522236555346_0.8952532582707036"},"_hasShrinkwrap":false},"2.3.0-beta6":{"name":"alfresco-js-api","version":"2.3.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"a8fd3e442a61ccdeb94e562cb9d5e305341b2368","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta6","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Ak0zKAj3rVOhu7aQH+tssYforYMfND3axkrttXRFsAs+wfFIIBSumzk7qd1ua1ic2INlzzxPK3OZuqQN400Yvg==","shasum":"06f77fa48fd273e25929ac43baced6700aef2a23","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta6.tgz","fileCount":1175,"unpackedSize":7998899,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDARrdjjooBU0dbJqzIwbE/VyXrpcOjovq5r3zhPW3dvAiAH2KXFDU1zIXjPSJAfcBOUleXhEZ9AxOHGDliHZqnI4A=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta6_1522418630223_0.1267496195101092"},"_hasShrinkwrap":false},"2.3.0-adc677d28cb4f3a4c4f3668a0fc02da1e8f2714d":{"name":"alfresco-js-api","version":"2.3.0-adc677d28cb4f3a4c4f3668a0fc02da1e8f2714d","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"adc677d28cb4f3a4c4f3668a0fc02da1e8f2714d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-adc677d28cb4f3a4c4f3668a0fc02da1e8f2714d","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Kqo4IyGrksdcsbxYtkBxVHrwp/r6l1pj835vvdTyDfSdO/z3kZJLX0aXdNxHKijIcVlJm4Ik3f6b+mpFDuUUWQ==","shasum":"1f43bd42c43b2067084b9dda6f71d40bec36924d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-adc677d28cb4f3a4c4f3668a0fc02da1e8f2714d.tgz","fileCount":1176,"unpackedSize":8000911,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDE+XtQdsDD/qbfvxx9D02NlHGDXf3oVN5sk00r3DECVQIhAL32ElnglV0yBcSUKB1cOgE6h0AJQSK+mISTsdlyytOi"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-adc677d28cb4f3a4c4f3668a0fc02da1e8f2714d_1522860123222_0.10409183148231094"},"_hasShrinkwrap":false},"2.3.0-11d6bf7c1189ef6a97bc673971de7c3909f10cef":{"name":"alfresco-js-api","version":"2.3.0-11d6bf7c1189ef6a97bc673971de7c3909f10cef","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"11d6bf7c1189ef6a97bc673971de7c3909f10cef","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-11d6bf7c1189ef6a97bc673971de7c3909f10cef","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-/zQiyV3VOvkiVayd9i0lAjgQ1nGB7J/ItRGdtjApFCHHY8Sr2j2GAGrug2+bGXk6LsDgSJ0EwqMo5+V1McnFew==","shasum":"e264b6cff5953e7ab65e70691e482050297f977e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-11d6bf7c1189ef6a97bc673971de7c3909f10cef.tgz","fileCount":1176,"unpackedSize":8001028,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7X2wnXRmU2oz6DXO4qdCfxEwt4SV4d1pIPQVYbv9lsAiEAtY5ckJGD9NynNxWl+syk4qayBEsA5ymWcZ/VvPi+Ej8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-11d6bf7c1189ef6a97bc673971de7c3909f10cef_1522919703698_0.36939991120029814"},"_hasShrinkwrap":false},"2.3.0-beta7":{"name":"alfresco-js-api","version":"2.3.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"11d6bf7c1189ef6a97bc673971de7c3909f10cef","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta7","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-MBheJBhSq4N2d/G67pXzO+isVxJhGNv8S5KXQLAZy9ey9+78zuROoo0nCz5WgUE8SKHne5v1YY4U0/sspjoZpg==","shasum":"edbadb307a28b54980a38143bc68f0a76b5f8a52","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta7.tgz","fileCount":1175,"unpackedSize":8000923,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/NaACZhyc65zKFltXILjf7gJUbrvyScj7Te9pSVuX+AiEAgNI+sTAP4C62ctLRVXi/A6c5+gqId3W+5UPrRwy/8is="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta7_1523023324430_0.5941827699999158"},"_hasShrinkwrap":false},"2.3.0-3f1a4cec6a79f4bb71ae7c0ef962539739662f09":{"name":"alfresco-js-api","version":"2.3.0-3f1a4cec6a79f4bb71ae7c0ef962539739662f09","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3f1a4cec6a79f4bb71ae7c0ef962539739662f09","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-3f1a4cec6a79f4bb71ae7c0ef962539739662f09","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ytZ919Qk6m/vDNwS47omuP026rYFfKEjcDSr2QDwSMHLrOs412ctSiRgo4On9B8JD5ErpGJHZotQzOt0a9fLYA==","shasum":"5c2b70e500b6691a83bd091a6ba6a03c62462ab5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-3f1a4cec6a79f4bb71ae7c0ef962539739662f09.tgz","fileCount":1176,"unpackedSize":8001084,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZZRQySPdfKjtCYBzluDlAfHVYgLU8BCYXwnju/+SDKgIgOcILzom3kYScHp7LJ4RAgRQTCNu9LYkm82huPt2lDjo="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-3f1a4cec6a79f4bb71ae7c0ef962539739662f09_1523202163256_0.20959361251095565"},"_hasShrinkwrap":false},"2.3.0-beta8":{"name":"alfresco-js-api","version":"2.3.0-beta8","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3f1a4cec6a79f4bb71ae7c0ef962539739662f09","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta8","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-GqCc+q/5Py2XK4wQz6B42/mR4uJ65T9kGf5hZPBNzGyg6EviuF3co69nBHDMzqpv3yuaDTUY6NJYNcYdD3Hqcg==","shasum":"0a316d3cbd063a3336193a821b0add47f5cd87b9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta8.tgz","fileCount":1175,"unpackedSize":8000979,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1jm+QFIdnDWczcp7gt6eUP/XYg2I23rqafSMtrVF1FAiByToV1RfiL1HDSe2DaLw2E4Ljx7IBj8277tfGvr0PLEw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta8_1523452160200_0.4333004470312607"},"_hasShrinkwrap":false},"2.3.0-beta9":{"name":"alfresco-js-api","version":"2.3.0-beta9","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3f1a4cec6a79f4bb71ae7c0ef962539739662f09","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta9","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-mMqNW7muoAT8axMQue6CxdtiVR+QeuJAz7wQyCb+c+PnUR5r/6GBAYsaBOeHzHL7rAw9ngNfuTWKZvFmxgmoTQ==","shasum":"aae1c3f2d6f9d120de673fe488041bdc91730dbb","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta9.tgz","fileCount":1175,"unpackedSize":8000979,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEWgvdh/2kyFlgVNyJDiSjW8GtH21s/TzONWU3kg+BzoAiEA89YKVvw1FQQMQKne4MIsTX0eAfK+oslgtPqqMXNsyjE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta9_1523628212144_0.9048863762192552"},"_hasShrinkwrap":false},"2.3.0-beta10":{"name":"alfresco-js-api","version":"2.3.0-beta10","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3f1a4cec6a79f4bb71ae7c0ef962539739662f09","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-beta10","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-lv9asjlk2LCXlGILIeOKwOHC60QV+3pX2ZRUwlsFH3TrLzNauEne3GpPgGOrig74XDr+/8D1edH04EmmwSOMoA==","shasum":"7f8702a020eaf9660dded624af11eca9009b58fd","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-beta10.tgz","fileCount":1175,"unpackedSize":8000980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa0iPuCRA9TVsSAnZWagAAVIMP/1XfFeYZTyZ/+IMNWcjP\nI2vWxtQFLdfiHG82o/mtVOHxagTZ+sl/8ilxZxGf/Jnapgj43jL55b8uDEEj\ngv7oIfoCrkFJ6/YXt7mdYLdkyvvJUGNOfmFvB4LWmy8uqs95mBIs7Eh4SHdT\n/BhprsYImPv54bKebZBBz1Bw7WHVSm2SoTr4DAhtQSBJFDYMieIGABN5jT/T\nJM3qpDizfHiV8otDi4rj9pZkMN2TLItHOhwW5x0wjrbl5c2ba8jdKe/lyF35\nKPQOV7aMEbha413hYWy29kW12XMaqlOjCA89arSBzfsh1C61dhqZKWxWPuqB\nT27QIWgB6E99gi8Z4RWAM3kJjqEOWr3OeGPvVqpGltWrtczYIw6gSA2RRZj0\n+TicyscqILvBVQpl88Z+bdSkTRYtSNfuhwW++pseoyGv1AkV2l2dfQ+P74xx\nABbI6tKVypkMpT0eEY3DB5ReCHqN1hF0ZK3XjZP2A22Tu1owo0HSfR/bzyla\nI7XsoDwdgsUDwUp9am3b3vLKLiYgFTZpGrNBM9hLOhklkETSTYC1q1wvsvrT\nk1yYMrLAH0SqLMI8gzlLxNxcrMbQJ2GoSENM3TKV5KZGq3C97Hr/jUoss6F+\nWZwS5wxO0C4O3nZ6JYUAkfR+dkQqNk1phCZ+RYpcz5/TSbx9/y17FkLAWLeX\nyQlM\r\n=K007\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICc8vpAx958eQ0b2FiXDCJwAAX8LlIBP21AYJeRNDCwzAiBzfeQkU2pkthDNheLohrNCi5mdvmxydhWC4ZAn9CA36Q=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-beta10_1523721197921_0.5080950238601398"},"_hasShrinkwrap":false},"2.3.0-2c74891085ec43fbe7fcfcd1102b388168bedf3d":{"name":"alfresco-js-api","version":"2.3.0-2c74891085ec43fbe7fcfcd1102b388168bedf3d","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-10)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-11)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-12)\n  * [Create Folder](#create-folder)\n    + [Example](#example-13)\n    + [Example](#example-14)\n  * [Upload File](#upload-file)\n    + [Example](#example-15)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-16)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-17)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-18)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-19)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-20)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-21)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-22)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-23)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-24)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-25)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-26)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-27)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-28)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-29)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-30)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-31)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-32)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-33)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-34)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-35)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-36)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-37)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-38)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-39)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2c74891085ec43fbe7fcfcd1102b388168bedf3d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-2c74891085ec43fbe7fcfcd1102b388168bedf3d","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bzXKIHYsyK7Jt34zHMzVHduXj2SuHTKUNc7wgDKJg/mEy4RwuyswhNiNtaItXnUv6Bgx8dHln+kKbxAUh/HxkA==","shasum":"b4439a7a5848ea01ccfa1082177c38632c60e8e8","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-2c74891085ec43fbe7fcfcd1102b388168bedf3d.tgz","fileCount":1177,"unpackedSize":8001630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa0kfnCRA9TVsSAnZWagAAHE4P/jpo8MOvlHaN7l5dGZ+8\nHpAOGVHHegTiQzRPm48sG/GYbQW3zDP/4HK6W4gOFa42hwv68505cy2dzrpU\nbuVYN8bXvE7Doox46XRoQS2D/HIjqmRBwLRC45Gkh3I76lP/BVfDF3kf7vOq\nfNfhkCvU6S1lwLXXGkdOELGNxomgYHoIle8FCPz0s/qpKTMhCroSeC9/Ry1X\nHcjbztDVAZ1b/bpHk6Pz8f1anT9TIrmt7cv4NgxcMUA5lLtdb0x42Pazi7BE\nuyRxSSKsTM8sCJ2ZeT1vVy8pS0W8wz8QyThArk3YaXxuXJzj8Omb6QgstdM8\nY7rOud3GdjkmlqRiPIjQ02L3yDkAoS3ca5TY+6RgRx4KCROe7qjr4/+teRGj\nmbJIesgBr9dUUF43rdBRMEqpNgw+OyVljyqMAwUA6AHSfh/H+r95YwLN9GdY\n8e3bfRjnhtUiUxM1plYAeUXoma0BBYGks8n3w1N9JBA7y0aZaZSmbcFUtewd\n2Z47KeSjuM7zZVOo6QcEwi9CUPZTlZTCeea6WyZq7JtmgZF8N8YMWxmucW1X\nIO8CafgQm/GvgPAH0qFbcsORzzMNDL1qRU4NJUE0tooaH2vs1jleS/nkWilm\nmsd2tLBuSFtIgpolJka2dfisVLh0XHJ6IbKU1fK86U6jzi3DvvtyqOqj5wzh\nAYYh\r\n=C5aT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD020xl7KtwmugfbcVgVFHWF0pCYqCBWDFbA1GVLrQSdwIhALmPCTS91J8AUZTgVPyOyuod+3jSgtlgx0LPDJ/0mpyW"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-2c74891085ec43fbe7fcfcd1102b388168bedf3d_1523730407049_0.16912841934463851"},"_hasShrinkwrap":false},"2.3.0-29e4fee16dda6fbfb7968649d134036e4d55a301":{"name":"alfresco-js-api","version":"2.3.0-29e4fee16dda6fbfb7968649d134036e4d55a301","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"29e4fee16dda6fbfb7968649d134036e4d55a301","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-29e4fee16dda6fbfb7968649d134036e4d55a301","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-QDAKvZPwuzPT6dj/KsI1B4/JlnpeG5Tew0aKaAY8FB738ejPeEiWgbBjHLDvoOzw2RlxFfglBrD/oMJAnt0ROw==","shasum":"d55eccd2f0196414e8f6a4fb846766c3f41373f9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-29e4fee16dda6fbfb7968649d134036e4d55a301.tgz","fileCount":1177,"unpackedSize":8002530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1eCBCRA9TVsSAnZWagAAazQP/iayuu5673TRDKf3xs2A\nuAbQwXY25Nd4eSdhnrXqD/px3NBXGvd4OaSKZsvFpo37o1d2G0XnDU3nUlEK\n55+gKvapPUJni39eLq8s4JKCs+2HWz6xNdJVH9kGS04qVFACzGcV9u6q0/BT\n1N/8T5dbq0gWE2cKefWwP2Fp6w6wN8tk9eSwQhCRPRh8s3sbX7n8cscBMQQk\n9lo1bvZyKR4YX5Ct/9GSMFd5Nuh0iDdWuEuqycsSBzK4J+b3IOAw7vABc7m/\nIQuMJ/1wGw/cFspU/AcSYkXYcQvWimkIfd//A0y6YgNrVyoV+SfwQlUrkV3E\nJtpBy8W8lVvRAABsxzioS1KaIP+kt7uBJ5oURm///OAhNBA4XLXPPNIcum35\nXBSKbLCDY9cwDgApz62gTw8hAkkXi8fQkX9zKj2iMwZsjUQn+rjprq4jjRCS\nrj4WdJ/pSlJIU5vLix5Oy8O3xeKxsPb4SYlxnx556zx+sjcqU6++/2tv8YJv\nvUo1Xn3ReKikoDGM1T+C0zNUY5nYe/zLFumpmnD1OFf7OnTE6SSrM693f4s/\nqnMe80mpCReJmq/KuShf/SzMg6o/xQ6wjRagpc6pSUBpE9JRBpg8IRMsaV/T\n7AN+rNdNeot2U/yN0jpU4f3IOKwZZK1QLaUEQZcp/FUFdaPHSb6gM1dXAzX0\nKjUQ\r\n=kSH2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBeW1peS+nE6c0mYk3224ESRhqJEb+0Tqh94ZObN1XuQIgERQjKcHlXVQ7OppLPhNw2H0xleIrlf96aSr5B5E5Hrs="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-29e4fee16dda6fbfb7968649d134036e4d55a301_1523966081291_0.7101405842648987"},"_hasShrinkwrap":false},"2.3.0-20521af7bbf48e0259bc810f01cdb5b085bc8f19":{"name":"alfresco-js-api","version":"2.3.0-20521af7bbf48e0259bc810f01cdb5b085bc8f19","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"20521af7bbf48e0259bc810f01cdb5b085bc8f19","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0-20521af7bbf48e0259bc810f01cdb5b085bc8f19","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-BSysLJxGEIcdAOMd/F1kk92KXuDnFwIM10g26EfykhTa0s+PVy0xxEkgQJ3QWeGt4OgNet/ViRkTnj6BkyRFAg==","shasum":"3297edae12564cfb22311a4b6ffab0dd82ed2f90","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0-20521af7bbf48e0259bc810f01cdb5b085bc8f19.tgz","fileCount":1177,"unpackedSize":8002510,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1iNOCRA9TVsSAnZWagAAe4IP/3ogQi4/QRnImkYvNOoW\nsUsyLGjkt0TEn73PkQ+ledc3RlWofx5g9CucbWwawikq+iWcyh5I+yYFVP/q\nGId75pxYLNTYsmWy5W2D/H1WG5IEcyTR+YnzlyrzjuMGtw67uIgm+KwCy6Yh\ns379m+EQqIRB8mc6u8gbvBRjddnDqywX/NrCYHRcPm1bjCneO596h3RZdEEY\nfVYWvNvdZkiA0eeTnXirMaPk6NCDh3pDR27fvoVWQRudK9zqDrT6vXDJya8V\nJFcW+ljuVs1dP9Q4YUizVIAxJfCywqAtD6d/nvnmkCNNI57kzVHxDjFjxf2+\nqChY23kV9TwFgl2W/wsYsggezp7eI7HTTCD0+hAXijmapqYw5GGyn/mKGa3r\nafO6o6H6Gx3MvM+ZJ4zVS/+I4Dt9bJnWtqmBc8BDcPF9J/jqjfTi9arv/Y51\nH8HdUVajfDqBADBNwkT3SijQ+9qCUyBZOH6nbSubkX5I+M1SYl39PfhrIkSU\nFY04i0v6w6GUF+Jgxwty9jvpxOIyb2B0bcBQSXYUCbMyQ4FGSs1EMgrC68CQ\n0bN4L4vhBO5xR2NJ/FsURHKALuU+P40nhCy3QT0G2W848rx0qjPRoDgYElzQ\n5EObO6MY093YOM/8YlPOSvZZvA6qJ4/amfuNNXWqAMnGCA9kb3ruwOENO6HQ\nH3f6\r\n=Qt8x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWcqL1eLV+cyfE0nw72yV3YL5XMOEEGTo0zY/OWkPbUQIhALVWvpIDk89D4mqkKnIVxr0pCnFjMk7oA4Rh4Pn0+nDl"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0-20521af7bbf48e0259bc810f01cdb5b085bc8f19_1523983181391_0.01509329543944804"},"_hasShrinkwrap":false},"2.3.0":{"name":"alfresco-js-api","version":"2.3.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"8cb94388d5b6a0d4be590b252c8703d1eb320e81","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-IhsSNoPl8cbw/V24kw420sGoVp6rBakC2kN4gKe3bPdERvSWRehw5bojMQhnSPDmS2PqC5C23HaVV+whOwkpDg==","shasum":"eb0dbf0e58cf2cf57ceb80cf3b9666282d4d1283","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.0.tgz","fileCount":1176,"unpackedSize":8002761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1iVcCRA9TVsSAnZWagAAdoIP/iduI8FUA3GUgojGDGsd\njpKqK8gYQ9rpLqqH9M7KBJ8R+RLVEToz7qbT6dvIzJaoHaMW8Uh7lNG+UrDy\naaUwz5Vp7kg0I2e6i192kIn03exOZXSv8jQ5G+gVkM7O6MLwFE4CR3Ujxz6Y\nnnon/A0UoevQqBPSz9HqwddkZHf7Y+gylJZiSACkffx2cgY1Rvf6g68F2z8f\nExnDrnbpgUcMaJ2a4OltFOVByykOs/fFOiTtEyUkG0i+jn9WB6WkY7q0SA3b\n1Y/1zqtjpdFFblTK+3KtMyLu9MR2vPzpbGopnLab7iG3e2HhZSqgaLe7Aufh\nXi+2Ubx1drgOAY16+c1pErPUwZUikwEwlUQL3pync2UKFH8ol1alDOynCKO5\nDQjr3xRpUAFp7NgD3MjbkBznkcdJd1soQUSR2qsztI7kmIQ2ZEFHPMexwioZ\nwmcOhPXeBlioHXkcLI4SCe6GESEBsk+FG/87VmlltPmu96Sl+GFOealM+uU7\nscQKtMm8iM4hYS8c0X/BmLyMLORbdiz1dV51Vl9JqYiOf1pRetv7o45sBI0K\nsTyKg8AkRGxb6puZeMFev1GHvdKvo7Vr9dfP/W+Kefzy2h/6mBicN6G19GOX\nySWzUah2RwLKbijBcnnVViAn93IHcb49GQJKHU1FuDe8kcDyraj+SfRTcikZ\nFbmo\r\n=Z46r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8a3YLIZk0HLP+wPz6qk3LHzkgYCxrHd0l+KSK+m0JWAIhAPJaOxNpaWsNPa7KV9hxc7thDQ1ijsFsBCtlAB/HsWBw"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.0_1523983707797_0.758744982537628"},"_hasShrinkwrap":false},"2.4.0-beta1":{"name":"alfresco-js-api","version":"2.4.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"20521af7bbf48e0259bc810f01cdb5b085bc8f19","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta1","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-QMmWLd6oZunXvRDUeJ8IK7ZhNPPCAw1+2//sDWitCMvHoq/53ChfzWv3f8ogOwxdVoTmD7IvhAFYkc7wV0Wabg==","shasum":"43f30a6dc06817b2f1102bdcb2ffb206f82ad5ca","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta1.tgz","fileCount":1176,"unpackedSize":8002760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2fMACRA9TVsSAnZWagAAGhcP/Ai6TEsF7k4LhpsDnYsX\na4Fd+0/fxHJyi7AK+73v/YfO4ScCMaJqcLaxepyA1BKH7RzrfVI9z7T+4Ozl\nNklUTwJlI6EBmr5no3WsZplnpei0uCBuj+LwcbfsvJ1YqKOhs/GwtixEeitY\nrt98r3pd/kje5T+bpnVm2Wc7vaQQX7gG+JyAsY6mCyS+0JdZ2e21z85MiCiJ\nxYuVEG816nvWrhsrlURJdWuhncHbc22KoWj5lopqPj2hR+x+9OGDyQw2GOx+\nkMrYWO5htf7+fFUTtsB8SKQvdQUmH7UQH7OIj5BP+SdsVVQTTwsDMfMDrEZx\nE7PA0N+X8b0p26hUcVK9RBjseMaMJMDeWAJ8CdwKk+mKNELrjFvwSmIEdBBY\n1aR7EO5ZHdKgbYvttyJxljmXGavrVBl9fUvb/bgijnvOTNlC8ZhSk2Rb2NzQ\n0eaaJqXCkqYRO96WdzSQL0oqf5kJtMeoKAsuvyCTQnBfwNG7kp0HmY4XDBgN\nR5xd1ua6JvLBfjGvk02Tz88HxbGOWp0dkiz4qjGBOQ24zMxzjcew/Jln9SNx\nI+U6mg5gdKDIZt4gwzpwwZaAop6lbOkee5RdFFJnGBJEeYqD3El6f/fWi2Ah\nUQ707We+sIxjxVEz8M5+VzUs0kr0xmFxxhCc4YGj1EBjIA2ouBzTVrPza78J\nNwOx\r\n=sqzG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBT+lo8dGh9zagE2gf7/t6CXJrSpk3n2I64uQXKz4FaAiEAnbiJC/4grSVoOzRZkpy7k7FBHO13PCklalK7qJqjC18="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta1_1524232959657_0.34342975695031397"},"_hasShrinkwrap":false},"2.4.0-a6e823abba12829706f4d3a978f7b5b339817fd6":{"name":"alfresco-js-api","version":"2.4.0-a6e823abba12829706f4d3a978f7b5b339817fd6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"a6e823abba12829706f4d3a978f7b5b339817fd6","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-a6e823abba12829706f4d3a978f7b5b339817fd6","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-gW3CQoJ+4VGn7g8qz1/PXtePklDPZNQwEYMrzM2i21UuYbOgcgSMpXFzFkzWuB2G3WuuZuxAePBYNGN0Yxh/AQ==","shasum":"1ad754d2739cdf3b809b9c1004b855ba6a1b1553","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-a6e823abba12829706f4d3a978f7b5b339817fd6.tgz","fileCount":1177,"unpackedSize":8003298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4KQUCRA9TVsSAnZWagAA9xMP/RQuoc9TqDIOsu29Lt9E\naPuKpbSC2QQbPArAcWsDgkjOwr1f2k4zBSx6nPzq+/wnnhFwOTlqQZyNn+Y8\nwpa1acnbWgs1L+ulmhedTr/wfETzWcI81b2hMn0j4iVT1t3yp1ly/MKF0qDe\nolunwZVjKKlqx+j6lFERTbZcseOMIfOpjcR/cJMpeaq7S6bvjsk74py4+HvY\niB6Kd/Y6ot4Axt1tz2f5zL5qbPY6j54XM3DErOcW7lczaQiyzhlhB8F/cuJz\n9hbMf70/sFSSP7zPbKNot8w8+USRlmU0fwVpdlLOIjLW02Wii1mJsSskNx6O\nOU+OQin6SyEWW0k+5TLYxfabLbuvLIdmoVDNWk4JHG0N4ixvT9PxKvl9foF4\nOcu9hWg9Q9/JYZ2/G9xobPhOk4cugx96gF6W9sJvYXHoYawqewFHVnu2KYFT\nOqpxso6EZrJX94IcNuk9/HcRr1fjCIzeT0ZmOdcbo0NJIOqRwVyrPF6tt0Tt\nEEuekouUy6OQMocDuFZ9WeGp41BDQ2ZytG7sADtqspKZKx7BcDr/NLoVL9B5\ngNpxfmLd+lLi9wHKNvpUG0FbvnKtK2WJqY57EEjcEfhcp8bphmkSuM/dWntS\nYOroejHVRvV3Q/IdDYAsqqmH5+b/ZfXEdSWBsdXEjDfNzWvUzeoWDvOxJGxf\nWTlh\r\n=LHY2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5Wop/cCdXjiTbx1vzKXzExDpy6wTo4M59JW0lDfc6RwIgUQiwopqeRV+VlT/vBOtZFas9ci1nFyOXgJif/2PXNCs="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-a6e823abba12829706f4d3a978f7b5b339817fd6_1524671508054_0.9009165483085442"},"_hasShrinkwrap":false},"2.4.0-6aeb75354b9b0ddb74444bfb449549ec21c123de":{"name":"alfresco-js-api","version":"2.4.0-6aeb75354b9b0ddb74444bfb449549ec21c123de","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6aeb75354b9b0ddb74444bfb449549ec21c123de","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-6aeb75354b9b0ddb74444bfb449549ec21c123de","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-8d9H4fY7rxPoSpDa42EqI9D0lg1AOQOnkP+0Qz1jkS7w/otsOcCT29jlo5Y1avwscS+QNrwo+RMTaVdGnxwqAA==","shasum":"e3a86955326a59630e193c4fa8f5889bb409f060","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-6aeb75354b9b0ddb74444bfb449549ec21c123de.tgz","fileCount":1177,"unpackedSize":8003408,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4LtGCRA9TVsSAnZWagAAKN8P/iMF82Ep5YW2VVEqeber\n7YzNp6qLZ0GaIe3qpPkfdimnpB1E60/v2jq/SFD3vazf0agxxm0yGQBQn+lf\nwGM7oIZNolwSVIZeH/QvHES0WWeYGvvuvyPG0YhRsjwua1USduC8DdanjIQT\nhCIH4TCmU88WtS0AK5Y72b3r4o2vs0cUgsh4GBGCUYGcaGcmVK6DAI4hjdE+\nrHye9Vxub/lENDv5VNat32WageliE6AMfTQJSDeRCoVXjCMeCwdyAS5wCoS2\noBAbCivtfLYA5VoXUWYmT7Jk5ZBVKz40Te3txQpD0TZUAaUAy8Np7NZlduhy\n+wFvjz/Go9ICVNNvPx1ZumUKgvq9k1QwUnws9thHTeoRcn/5BVccS2Fi1p5B\nrKtImJlhxMvE83PygzP445swjrskJ66mqI7+A3wL0pYjkc7rKsF0zYT0hVSG\nLs2WRSh4c4ct7UekVmfR5jPu0+iQ0XzfU9WnDHroZfl0e0olZIBHi8ruUXbY\n6zgzZWEBe6c1z67+gdm/bhrLT/7klKzRGkIcSpBtFDR3f2XXLuUvJGEw612M\n4CYDKmdwfGRL/f/xLl3h4IWrPwBZ8wYFUt1t8FMscVCtnks0wacqNPs1Z4nF\nL/Ck7XRVYGv/iNA0ot9DlI6ju9JqNHmwmN4vh6pv05ghpf0ZAssrAxt8v7JL\nqkhB\r\n=1tzz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHw908v6PvNtu73YGM4qofpe1E4xY2LkzNjgI1ovrk9xAiAP+J65KMS+IHwnX2Y0OqwMLxbjzPXmEVCgxjg2/bkcgg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-6aeb75354b9b0ddb74444bfb449549ec21c123de_1524677445799_0.04935354634049971"},"_hasShrinkwrap":false},"2.3.1":{"name":"alfresco-js-api","version":"2.3.1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"6e636884fc93f23eda58952d4bb0c33c327b9e7c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.3.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-F3DYjhpf1aY2q0kOqjgUVTh+OaaFGaiWriBISbf+x6myGY9V7MeLC/d1uRhb7UhfE8FJfjLNVlS5+cHDgW2R1w==","shasum":"7c62f27459e786ce06257a958974e117ce7f37bb","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.3.1.tgz","fileCount":1176,"unpackedSize":8003116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4L4pCRA9TVsSAnZWagAAAokP/0gAEHqQz+BzhtU7CysS\n6pAygjPTy6lAiyRBHGdGrHBd5A/skaZv49JSNzuZfTCWPG8fRDWZjPh1Jn9d\ne/4rSREGgE8Dy41tHHO/ZHfJl+5jS2fNxpLn40+GyujXaDKt/89oC38Ml9Do\nGZl47sV2mray/KWeH3RydqN2NwuLJBxX3GxWuduPUVeEg8AaGRwzBKmujsJu\nPAncqI6mf+EqAwE8lIqRwiKHVEcuDI9SN+HG+wYCiMJ4akVEFCOnfG4vcsur\nj71GKYS5UOtZGGlhdRWLuVPaibuQ6o6BboZENMlgRKG8ADy40yXOYPTmZaV4\nGbmZPLvFUodgP1nhpDF/I3O6LrHojzQDYhSq+o9hVCL7cTrJFA2ISHE7hPjs\nvFs5/g+Z7BmnJHZlbd6Wq9Gr0mwWN7+XVsLU1X9yJt5iTfOWeE8N/5oZY/8z\nTVW4ZaWy9dwKKl9a/n+ECyNQVxGChY2JLq6ozovwvZOj9uoCcJtrlOMaWBgK\nVk+s6qA4ce8Sgg3FTb4now88o+C72wK4Nhnujmg8K8E5aWbxIY5EShNi+nAB\nrDxueW4bWL61IdqNn2UEukxW2tykM8Kt9bFySKoCewiamiRvBGYNw9EwLn1m\nptPNv0sx3UMdrkJEruU7FdYHZeDomCMqb0sCG+uW9cw8btx2mDsg/UMEY4pP\nDK9M\r\n=8Z7U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIozv0+CpTHs3wpRQIYn2RCMCankZXt3jWVe2AK4olFQIgGnf8LrEemlQDQrW3qEg0I+NmE49W40T71hER/03CQio="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.3.1_1524678185689_0.13989249745124055"},"_hasShrinkwrap":false},"2.4.0-beta2":{"name":"alfresco-js-api","version":"2.4.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6aeb75354b9b0ddb74444bfb449549ec21c123de","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta2","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-l3hYboYyb/ibpxnXXeLBwC+Lu9SjAhwAEDkFHCzzY+XkKtraa3q2ipQbyu1isscwpeTW3BBFLhAzcBtHbW8rxQ==","shasum":"b955eb02a5b7525ae8938f6512265e0f30dd1925","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta2.tgz","fileCount":1176,"unpackedSize":8003303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4y2CCRA9TVsSAnZWagAA8ZwP/3Aftds9nXaQ/ua1cO7Y\n1MnlNP/LgY/bHYmsG68RmD6T9Lo7LgWQcu8A9TbHMNlmm3FQ5hUZsBf2+2cx\nAESHwRI0eyHc8jIuHfjJwjw6RUOLDLucISnBjV/qKBU/NZPWCfDXAuUv2gr7\nK2BSrJH/j80IigIoeTGU/rm6DcrVvLCBbt43m8h2bcUfMex95V5fuW4Kv98G\nyS6Ox5ZdJrmT54mAZVxpAddHVsQNbjSGvpFP566h6wn1AKJtK4LT1lcLaBYr\nxSjuBHVuyh9zc6Svh47XCjAMpNupkp5NuUvKLooNLlcOnHREYtndUMcHb9Ol\ndd/CRj3C+MAuOmjwEOPYQdX8uVr8fRqMCAVMwcnFERG3rBQYodBHkSilUqEk\n6Zq7WL90ASqv+DONnrT+ZMBniNIBpI96SyegSMOlC/MZCJQa9L06sD8V3zQ0\nRY26VebHT9FV2ncum+srxDjj9Q4QRdrg9d09jUQxheebxeQvM5gKibnm5mac\nbNUJ9jyNQROGjbDMDM6tCAYDby8lp1+zm9N9QjLD8xV/L6qiekSgT3ZUt44y\nnqU8MVQ6POIRMvOKLGhx9W/xrwSWySez+Nmm74wa9Dg+q/XL8LHLQCnbMwDh\nevMVtbPztVqIXBAvbTKMQBxjijm5SAd1IJqq43xDtg7r0WDJmfWhYjbLZ4zU\nL4pE\r\n=X/X/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR4SYejMv7ctKgEHfErhUeLgLA6F8k3lZZi9+oD/CGqwIhAMyKYiw51fBi1eZ+eIMlQfhCbn0jLeBkN+rOTzMaSNSl"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta2_1524837762204_0.978254198580734"},"_hasShrinkwrap":false},"2.4.0-eceafaf13e1df3bf2c95e1942952e8806ef9124d":{"name":"alfresco-js-api","version":"2.4.0-eceafaf13e1df3bf2c95e1942952e8806ef9124d","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"eceafaf13e1df3bf2c95e1942952e8806ef9124d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-eceafaf13e1df3bf2c95e1942952e8806ef9124d","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-XCpI0krsUXHrDvYd9USVJ5qB8+dGl2wOHWJb4rCofwff9fXpn5iCY5U7eiGaENLTQrc3098uMAt61Owwyk5kmg==","shasum":"4ace4cd8ce14a6d954904dc1d30c898232a16148","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-eceafaf13e1df3bf2c95e1942952e8806ef9124d.tgz","fileCount":1177,"unpackedSize":8005534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6YaLCRA9TVsSAnZWagAAJO4P/RnYCkDGKhbe5meXG1Q+\nngfYFaJ3dKcveVzesny+nSjaQn2lhyYyNVlXDooJppHpWbB6s8wM0ZJD8SYF\nxlz+tDl1aqgJOMmR722P9Nz72uD4FIwrY+99olDe8CRZ+i9727UC9z6tvw72\nTUx8uSNWDlIQHSQ7jfkbn9knKGXNjbpnhSyjS+jAk2wXb+MmJ4LIP/vqbG1J\nbifY+/jtONrgZ1DcEJFGYLHVOrDcFeRfabVY0QSKVg63w55pLghEpPLK8clX\nP0ejvinLaqtLVn+EZEm6fRXxu9Lf2Fq69hct8VGhGKAiOBIGHv+as2mTotva\n2rFKMIY6cvbwMmu9gPlMPSrwA9MxTejejO098eeqhFjXkuIKBDUgcXEGsEdJ\nxNbl2WVFj9z87Ir8BRLu09DobvxGelqBt4l7sa8DFi0jO4T+48hbp/8QkS3m\nYDTfJNtCEEuH4Z+Q6K/QLYL/GwjIDl8b9nVnE8JCOPvnrITxQm4txeqbLWyf\ncfQTmAzWvF/j7++nAnimmXM+zRZTo8tuaAvFE+BCzdBJbPGV9cB60/jVGoVm\ncyEjiDGk+/Rau0gz/4C3lSvhGbT2RSK7a4yXurvzYko0Kfjl0UlqBMbtaSIR\ni0T/jHTOAU5mDo5cfzB1wgGnruIZfeoDO0ORiHmSeZREJtx0j/M00r91eOBU\naeCr\r\n=15KS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWf5rwDgCCOaMk+oR1mUDol/xXgq6y3Trqde/3FQ7ZLgIhAJTUmGN4RpbPNnS8hwL1uUe8mwej5CONvUcFy3KmZnT5"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-eceafaf13e1df3bf2c95e1942952e8806ef9124d_1525253770833_0.5564031346635692"},"_hasShrinkwrap":false},"2.4.0-fe62e582941fe26a93267fef9d2ef0f1048d96fc":{"name":"alfresco-js-api","version":"2.4.0-fe62e582941fe26a93267fef9d2ef0f1048d96fc","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"fe62e582941fe26a93267fef9d2ef0f1048d96fc","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-fe62e582941fe26a93267fef9d2ef0f1048d96fc","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-2sv3ktEJs+WX7YzN7pifUOsL0A9+j5uek066YO9fc7XidWhpNDwR0OEgdQqseuLmE4gjZVnKaYKNtQI2i0CQ4g==","shasum":"eb173c50759d58f332396085c7a0e1f6807c87db","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-fe62e582941fe26a93267fef9d2ef0f1048d96fc.tgz","fileCount":1177,"unpackedSize":8005531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6kn7CRA9TVsSAnZWagAAxV4P/R/AO/zDh04HDzQewyXm\n47u8yBzNpm21jMRsc9Skfc485ZiNKL5D6xZY7P9jWg8RRCCZhmcLV6nMhThG\nXGKEVwk+U9IpJaraH4L6mZae4XAStEzYT6iKdcX3OfU2vpYv5qB5kiZj1W2U\nBSkw/96engcUwJvzdX0ESfPg/iDBT+FGT9jsjVDhvw6zTRZmT8cup63QbK7T\nYEndf83CeWRoA4LbPfIjTuSrbbjnxb2mEg/FpxSFSuAFKDEAsBnENo/3ddMF\nX+ZxJByy+JUftAmyf+7zwZ6kVAil/db66fbLnV7rTchWtPB5VQ+Zb611inoF\n6mA+Lb4kqX1ff5MHfgP1hQmMsQkVdYbRAVhuJhb650BqMBdZKuXH7PCn5pND\nv3uFy15rK4N2y0+R4Yuc/+FB9LojwEWQoB6k88S2GGfOzpDX98HkRWqg1gjX\nooeUA3A60QhrCRB1iPBPNMPyDIvTvYxsuC5+Wkmp9In1krJMpN8GTTiuoyBf\n6cB2Xz+8vVgUzO3YV4/gFHKDZbFXNjs3miv7QFXdtg46PlFOdARkrb3V7pEc\nYAC/dG+e1z/hCk8vi2Eicbsc7fUX7Vm3obs1bcBiAeu9G8QHVYFlmQ9m8YTR\ngwGm6pXJg09rhl7yp+ta6iVoGzMXOqq3fHY4OjdkXhX5YwAsftgDu+ztpW8K\ng1tl\r\n=ZU/S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDj+iXLd0mdQ9nWOkBfdoRxJtBZkQWYTI1uC26jSnSDOwIhAKV5bmxtFaZDgjeYxuON8NqgZwVD0vKVnmdrSp+/d2uo"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-fe62e582941fe26a93267fef9d2ef0f1048d96fc_1525303803404_0.25461255705714425"},"_hasShrinkwrap":false},"2.4.0-0136cbeddf740597bf0189c801a3aeb73d51b285":{"name":"alfresco-js-api","version":"2.4.0-0136cbeddf740597bf0189c801a3aeb73d51b285","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"0136cbeddf740597bf0189c801a3aeb73d51b285","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-0136cbeddf740597bf0189c801a3aeb73d51b285","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-pwQTb0XSeHPEv1CxQPcnEOZljbXbICu9cPHw4jBpJCKUpDZ6wI7tCU++VxqVyvfckrbiWx4R/E1bMSJxKpw9Pg==","shasum":"eedc64a22a8540282c5d240a8152288784b00529","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-0136cbeddf740597bf0189c801a3aeb73d51b285.tgz","fileCount":1177,"unpackedSize":8005540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6w0PCRA9TVsSAnZWagAAGhMP/ihGzNwiOPuB3Xk/IxsE\ngAstkkRVOzcAboO+7ZIFGXjrhaqCShC7dqhUMcUXII7JJjB7XeGkaySjjoyq\n+/z3T/p+NAmkQwDlYoWtQbm5bhdtaZ6YXJ8SYcgrEjEDj8HEr9a2eAyUr0+B\nUTb/+ooLcchjHhyC915n81lAPjMceJjz2tuUHjdhSuvJlxz6GgWnVMgdEnnY\nwGIKAmlEhl5pDpiVoff2hEHDtYv/HTlEcKGatZTLP+3Ut+m5o106jnx3oEPE\nIUcN9todlhpd1o+GzqOCx/HgZw+PYTK1dtb+P1D/vvMSM4sxYMh5uqjWgVJm\nrQuqCjZK0g/YxPYYy5dXO8cvjn8Wny10Kg5VFjfZvM4+xiOphBJUAYtqIXSh\nVR1cmexJmeE227ra6P9JuOgzRJ03c40POEzeCn0PYxiZ1UOtTFSBvALJ/YVr\nPBnxT459h45JtXeTZLMunXXCuNNASQxHcwPXfibawGkHIeDKimPL5HwyaZqN\nIQbj8y44B8MxXFCLsj07hG7Sy827kOSiXIG212y8X6fjrWHBFrqboU6Bbg7j\nVxVeSXvYa3WEvkcAfxbY9ZCGMdqbfqAN0RLuxGNrPMdo9yJC6hJH4tomBIsy\nU3qYM3ONJ1NMwSItBFXBw0YSIey3akKiD3Fflo2PwqDnr+Pw6Q1IqYdWoHux\n5Z6s\r\n=2zQ0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDo9WjyUhS1EJ6/pT4yzsrbheFpdbRHCFdvXfLVfU1cvQIhAMF3Nkmp/4Fona+FJEjjRT0uvs1Bc09qwu1Z4tgb7Dpo"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-0136cbeddf740597bf0189c801a3aeb73d51b285_1525353743082_0.5030567814191387"},"_hasShrinkwrap":false},"2.4.0-4004714595dcb24619ac8519e04441797985080d":{"name":"alfresco-js-api","version":"2.4.0-4004714595dcb24619ac8519e04441797985080d","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"4004714595dcb24619ac8519e04441797985080d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-4004714595dcb24619ac8519e04441797985080d","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-oxzL503bEjkh/WDhq+3VNAu1Phz3Y7BX/ZMuc+uRGANjlOahxMy9vtPJitH2rJpH73EzAq0f10WrB2MXOmkmfQ==","shasum":"e1665b2de8ca7d66f5ee2085aa7501cab6333126","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-4004714595dcb24619ac8519e04441797985080d.tgz","fileCount":1177,"unpackedSize":8006919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6z9xCRA9TVsSAnZWagAAdesP/0ZlakWBQNacX7sXM1OY\nKF9rl/ppJnq4Dwe7lhLdzqcwqp4O9TBtINZUIgXNOahkHmeF4B7iRX70MMNh\neiWD7yToezACOt5egdvjmMsXh5F+ZeIL8hE0yOQd0Ngcpkbmzp0eE1dijT3N\nSTxvwMbBVMEXs7PnyY6XggemEIG0URe6U0SNx3t5mlXOLcLdZZi157BwQSme\nPNae+kzhpBG19z4cOFCI3R52lBGg08b+Y52i5wz/qBj5EGQaKy8E7ji4nON3\nxy++Fwnjw6X7+kiKPGiuT3O8ag6dcfJegB4X53MzC3+kwgkB1GCTBOE1UBBo\nMy6wdE7vgO0WtXgNb8MWOREa+D7/GyOKyTOopEei2BpR44LVxIx0T1r2wq6g\nth67DKCaWySWiAO4v/TLz4W19T/FDk1/ytOGwCy1oFehD4zEyd2TyxaGYozz\nDLphnfCzUSMnyMRXCBEU7OZkZ+QYr3Ssxj6d2aw7Phzwrn/Om6fZGz3Sqbuu\nfe3AZ7FvDZGLqPziG59VpmTiuI4lxLBIvCAXFm3DFiXrPeCLG6qWFjCMvWIQ\nWCos0uVKkASJitGn7wccmUi9xtGu4GlHHitqMe0k9HfwCvdxSPp3KCCpwyeR\nyT/4Bff8UeNYT/yB4bZr3sBEAsWZ1y7jCBV42fzluPDUwKITIRumo1TUDMCX\n59c8\r\n=ui64\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+UVjuLaUlXJtwMSOrLjbeifpG7EM64RYzP+6Ynnik2wIhALwnUpkswdmVfmxSJcV8T0ABrazhd4X2MhWe8CaMah/y"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-4004714595dcb24619ac8519e04441797985080d_1525366641058_0.30801543858264124"},"_hasShrinkwrap":false},"2.4.0-31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18":{"name":"alfresco-js-api","version":"2.4.0-31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Ty3QQdvP+6/Fqe4CUuV6fYqkYG9xYvshnrHEzsFju36FSgNkWxZcOmwAAGVIWeNnCA7DuQqE7D+Vp7pgnPNTxQ==","shasum":"afcc65d19ee9e8796c562f3e71b21cf010ffb3d7","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18.tgz","fileCount":1177,"unpackedSize":8007015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa61JoCRA9TVsSAnZWagAAxo4P+QAZ6+CVMiPHeauprHzr\nLZ4omKijIeIBgXEPtJXAPiWkOiWwcUtNFFXwEPwhAHbIWCofdv2m3zrxeBum\nHzUDG/RZf0nuydqSyZKpzVEfrCmeT0ELGIqNn1cTfhlEVEwu8Gby3BC/EDxy\niyusiLBBx4vLGPylsYBH6Y3mLCSs3cNJVESY+1Fz990OoNe0hRXHFSPOpJOE\ncBZD3yXzzNefSqxHZQz5cJIpl/9IqmmrM3ZFhbP3U2o3cqdwmgX4XzQH4X9p\nKr2fNoym1UkWr7Mj6xyIVbe10iA9GNQmdkKq2scD0WYcH9tBCr/hwl2ul8tc\n1XV8E5ro9tr33E2v9cOFiVAwBpjazfY3rBBX4w4UJ4aTiUGSMN1LCNaRfNpQ\nfUWFmBrJKC66HhSaiJHpgPPk+X3RtqUsXUhBHPNmmO0T52+lbCG+ETv9uDjP\n+wVfhxd0BYBXUYCjnIZ4IyM/WYj1Zn1YRANubtvunZmuGC28MQVgcCoyePje\naMb5wgUrrODnUaTsh0S+S0wXfvHc6x79JmqO1noNKsjg8CjLa7DUwH+4CZz4\no/tE9bijT6zSdsocjjhWyph8LV0lSdIot6m2+aEcLUIZIgJ2bvY5t3//Imrz\nlAUe3AZr+Z2hshsdcZP1s1c7Hd+a+umLkZeGsREqvcsANnG0kvHP36/K8Rcj\nfFJP\r\n=5TvO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnZ0bQPN58CtWz9FGVxf9pAWkwzYTpuoCHX7OWv4nd0AiEA3KnS4p2s55JycKRlsoMvDFI+8gNQ0/dh/adwM2Pkuso="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18_1525371496580_0.7975577346206146"},"_hasShrinkwrap":false},"2.4.0-beta3":{"name":"alfresco-js-api","version":"2.4.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta3","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-5OCIBB6zIkROaFf2/CS85i/SNYkiu10wNnm0JbEe+d1oEG+WjMhBneBn2GDvFctFTlVa5h62hNDsGxknHcuhLw==","shasum":"8acebadb564e95b657ec089e08520847c1ac7e7d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta3.tgz","fileCount":1176,"unpackedSize":8006770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa7Gf/CRA9TVsSAnZWagAA3XYP/0B1Y6ypaqFitfCbKD06\nKcCsQNRM6aGTlqKmyV7OLionsGnfYes4kQ0Li2W7ZkRK2kmHHqWXoKwwit1U\nMbb8S28SIqDXXTi4MqGm+gMCfZbDsVTREkT1xhYwMvomzW4QL7WMRu7coCAb\nZgzMJCFiF2y6eSGHh+u8FL3TQIfQhBfiGjuAtEqcaqva3bz/tJwpXwpEkSob\nTjnB2ZnvaJtujO1tU8zZV3Uvlc7st9rzYdEp+LLD7PX4xJnGChadkPmJ6CHn\nn55FkgjqpQ6AsjjVNN2j0e4+BLX1bqK7CkSufo46h/XWRn28ni0Srr8u2Rv+\nIuJvF0067gvDWGgICJeO5RNOsiWG1xHEg1FXHTzU9hxgMq0+8SRKgAWsGb5q\nJ+sdkbiw6dHbZNtFqzTEy8XPsoREEM3vHhYe1KyzEL+Zl4VmJYpI3O33ghY/\nEfi/Ms9hdNg1FvL1hoagISIBJrczd9on9tOwYGE7yiGGHMxwIy7VFBWyJ67T\nSpZBn1YRgLP4bbqZjudi7Hl2AFf5ClZ0UJytQ1MGlfnsp9+aAtFNq/kxo8WZ\nE9vQt9mpj0TUmsGxOX9jatDaIwu8YdrhlkuZ1ImR1YN06UO1bpDb5WerVHR0\nhnq4g2WBLGYAlz90nSl10a9V2FZBbJseLjh1ADBpQyrqdsxW4ZQdsdQXaHOR\nFBV8\r\n=tz7R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHrUWZh7nh3F67mYj2zCHjyMgL5MEO/u1YCHEifpAZ/AiEA64VUIQeW1MrIZJOY7T4TOuiUwkWxQ0pbHbOnE5eH09c="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta3_1525442558863_0.6444618463395722"},"_hasShrinkwrap":false},"2.4.0-beta4":{"name":"alfresco-js-api","version":"2.4.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta4","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-mptLRp3fdXNxKj2HGNgZl9ptj2xYj8UL7zEsRlmYEIi1pW6z+MV2PSntXY74jlOg7MMHU/dkm/uW/t99Fxw5yw==","shasum":"3f14dbfc9f75acd785e2fc831559ddaaa7209c65","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta4.tgz","fileCount":1176,"unpackedSize":8006790,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9aJ/CRA9TVsSAnZWagAA+tsQAKIngEYbItj0g5eV4UFZ\nhs1Y77eENmbtcntGDN3zwIgU5pMzJaiNeZdOZ3Ilt6ilnzjPdu5OmUgbybwv\nvUPrrEm/fj+pziqgYYEJqX8n6GIgbSLRcIdGZ65tZIBosWua26M5BhZiAaaG\nvpjkzWchfPDQ8G8E8IMaYpgoG5rkg8vLBlqOQaN+vrVY82JpymI5VPndpGis\nRlkzAI04mGKWCr6ZMdIAQQk+1EPyBLxHGTL0gH6GtqCJrtjBBvMVb2tmVz/L\nd30i6UINm4Z9X+d4aI1PrDmoTKU0dDp3AWFDxzQsRin88FQGjxMyGvFpwIoC\nEbxvykesINBpjGyYrymeYJO8tuWZCSP+JQPtwgm4OzZSUxCDM1nWJWJlql44\n91kt4hEi12U1cpc27r0ME7YHlIYJNjUW4fBQmhPhk+QnEaYkUrZyIx5AThA5\n4Dgn7TCPGLdqLBMDuwiT9Kd8Dk7DV2gvCdvJWkKHV5Tp+8/PFqXbxOi3nhox\nwMm9yb6IZUNw0uZKemqTCXgrozMPKlJUWlrQqJtajF6emmaTRh0cAxr4yx1e\n2TmUa6zgFjlq8yYHU4j+/lqgMbWFH37qcf/U3V/fWrb4GjU7i1KyQDJ/4dB9\noZD2Umy+SwWQVWNowQsYteEhtmTt3MvH6mX8mKB7s89Z5vt+bFO3ACKyOCL7\nC6oB\r\n=aOC6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/C/8OuF0RvZq5VFfapSSaFyeSUBHpoZLw+d8TU4BIdAiAPDy8Q0El1Fha3tqEvgSRFtC/3LPcePwlyAclZdbER2Q=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta4_1526047359072_0.23644878832233096"},"_hasShrinkwrap":false},"2.4.0-d25b88191918c265e4b25faac8f58123f81984b3":{"name":"alfresco-js-api","version":"2.4.0-d25b88191918c265e4b25faac8f58123f81984b3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"d25b88191918c265e4b25faac8f58123f81984b3","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-d25b88191918c265e4b25faac8f58123f81984b3","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-2c3jibn1DmEMA9GYntB6Gb7QeEd9uoNSZJ7C7I1fNKTuzKTwbckHPcYXjIKcmwAkDVoBenCtjBieMo77XKslog==","shasum":"e2d80f68a932bce1538294af0e65544d57e244bf","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-d25b88191918c265e4b25faac8f58123f81984b3.tgz","fileCount":1177,"unpackedSize":8008145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/U3/CRA9TVsSAnZWagAAIPsP/3IfaHARZD12qcn/scZ+\nnNHzj5hf3lrObwP1hCEceqk20MOn0dZ6YmYhe9RsaqmmXLsKG3UoSttEhBog\n3gQevSvUmSbQ0iBviMIB5XVIfb/hwPZ1SrI7vjD68a4Dn6XYKWaYPQo0L5GV\nCKZjvPd4C1bFPbIWMCV6tVMTJvCmFpyU8CZCL8HAtqhiYz35U2ps+f1UXFRu\n+eFa5snM75K1A/z8LYl4tBq8oqkC9SNWH981Mj/65lE/Vxt1ufjrtGCMXfyL\nqZ0azaJn6blIjmWYkWQZiRy7dbTqCqHN3QNwWyJEFjE/IsMx1jFBwkLHgyDG\nZK6a6VzqLYfYbFVUU5DKuB83gU5/YG5psrogwVV3WchZuEWqdTVSukcRcQFc\ndpa3Ixoaj152jDqAU7icppmK84GHbzvGDX2bgVe3RJanZPRf/aERxdOWK3gc\nxmlwRVoE8zyp8HSEEEX7uPfgGSQemOVLbE0xjVPerPok/agJG3vXN/8Yr1/G\nxavDZ/tr3KFnnrpyxmseim+dVomZtpF1eNo1OdStSYHSbCNB2i01o6Jc9hs6\n5NOYlbeMT+6fyzagLwjAJVpStbVO38/Z30MGHb9XHDdidIZQLo+z0QOsx2SC\ng3Lfgo/Q3JmTcsn16ddSLP8/2gyrH5fDlZHwe1Teg40byOkhLJtdkyPr9+KD\ndWfu\r\n=zSy2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5coHcF95qXZNiBD9Y8nGLbER9OPdK8CrSVrEtJJQLlAiB3yNSNjNQOWKdHe6gaCFaOVR7jRwoqyqb2dzCGonm2gg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-d25b88191918c265e4b25faac8f58123f81984b3_1526550014730_0.3622435652333915"},"_hasShrinkwrap":false},"2.4.0-b63fdfeb4b3f4cd13be763c262969e503f99f533":{"name":"alfresco-js-api","version":"2.4.0-b63fdfeb4b3f4cd13be763c262969e503f99f533","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"b63fdfeb4b3f4cd13be763c262969e503f99f533","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-b63fdfeb4b3f4cd13be763c262969e503f99f533","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-UMktOr5fZSEUGbtjeDVLBRkjdOysHCeGuhX3NT9A9y2dMURiD8wOospO66Ey+7nGl2jhg1jZj9bzJuyBn1W3+w==","shasum":"96cfe26674f3e7dafc43118fe1f29f46ba5bf4e8","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-b63fdfeb4b3f4cd13be763c262969e503f99f533.tgz","fileCount":1177,"unpackedSize":8008648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/ropCRA9TVsSAnZWagAAb5MP/2Udtx4GSJptXWOYQyr2\nTvNR9hZQqxJRC4ihqqk+VWxL/f+8BodRxovHG1/0HKQzO/77qc+edpFupmGv\n44V9uWvITPn9xT30xNZCr06UW50Ke49K2wqCt4TtUTl7A/PyidrKFZf/iwjZ\n58/DYMSbm9psgC7F/nmRbkH8SyRm392NpwbGq/OYUid9XrHsR9/xzVQ2Uihc\nKJOdpyeFQvVNrzTzM+UTChABFovJ31Iiu1IYorx8djWtgw8Ovf005zwMlY+H\nkO03got0jo0vpxpE6jaDVYigN/gV7eLnMZ2241Jcb6JLLhpi3HwXKU6XPKS7\nl4VAjCg68L1hsZyJLU0fUM9Zh46RQEZYo4Mfi0L3rVQ7TKEf0eRjbvO0Y3W/\ntc4+6TPiU98O6+TkbcDMMLwKOZcAW1Qtv0kAIakeHgivFodiRpkBTjBOhRf0\nXkq0rp9xCyE8keeYBVlwujXVLao+tfo75tZ0mgKsSg5bJsJAC0+HwEulJQGo\nd/JpXrhPTbu2cnKTdqNjtXlXGYaVw0FdwBqerPVMe4RIGJ3GHn3q4Ihljfpm\n6oXh4FpH9+1zEf2zLUqWclbTyt/6eynpBWTIX6q6qGJJjEjwGP5U3Mh3dONt\njDTQkfqPkYts2QTEoB9C2gusBb/FrOLrROxp6tHcuzONgFrOhbfuOlWP2IFl\nz7RO\r\n=PMSc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgCF8VgTG5ba+RS8CbtN9G80ANN3ggbfF3QofGMtVvrAIgPCfkBs25JR0SEJJgNjzSzuX/UcPFlFFJybmAUipeLcE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-b63fdfeb4b3f4cd13be763c262969e503f99f533_1526643241184_0.756029520729756"},"_hasShrinkwrap":false},"2.4.0-36aa0a47232b95340577905cf72edab314e5b12b":{"name":"alfresco-js-api","version":"2.4.0-36aa0a47232b95340577905cf72edab314e5b12b","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"36aa0a47232b95340577905cf72edab314e5b12b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-36aa0a47232b95340577905cf72edab314e5b12b","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-AgClhkIKsXDZVHW+mQBg0hvs1WHZfi06U9nZiJQX4davcyvsW+H+osJXQ0CnXLqJiqRzKsYfv5/jMaQ9+P2+Ug==","shasum":"c494cdcc11b27fdbc9e9b45bc4ab93332fd625d9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-36aa0a47232b95340577905cf72edab314e5b12b.tgz","fileCount":1177,"unpackedSize":8008584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/sYOCRA9TVsSAnZWagAAjLIP/RWh/8LfGwRP84LDnAuc\nd+sXMcWGE+i9+irin9yA0VcMr53JMuUtt6GwpSu4MOpTrySjFiXE7on9BwbT\nlmjkjdJwNDk3oko5HPRX1z5Oh1Pyu6dNA+R+acnxIieXMzYe6n516yTQj43S\n6heZYkXtffjJBUOQqyRvwptqHtRhOlp3Fy+wmZCu7BOlEJgaMcy0E30cIta8\n0VoIVOtWiXyUYIBZ09glgrBhbsDylN20F0FBzNI0DMf3ULf39t6n/48P3HAC\nuq3Kfoswa9+96PuMJeqrKVm/m2vKD7wVYLqgOFihwqnD3q5HMistfwJZRv8D\nz1mbtLSwGSvhvBXaRgqG2yl7Xm9ctDaoMgQrtGeT9oQHObH8qCUqOdpi3QOJ\n6fTNASNYDp7nd3dSABYoaVnu8677u8BpkmWSKGy4Zkam2PCQdM7W7MdWWtiM\nFi1LQcrjoJs+A96oQRY1KmAG0t8E3mBXNJlEDnSYjefpN2KpIpqwlGqdU+1T\nCD9pAtU5/u8YPaQlrx6Lc19G4Rsbg3ueyodDKfxZObPFB31vDoa1ZdDgo5mt\nZyEt6uUo6Fzou9U3issFhNg+6cp/vA1BHs0nREEyeJ4BJWeyklWSrmfOvRXS\nTI8t6uI7qfPP8hDASdR0OGBrOSlazxRaWtfGpzBGkUPUi6r17GMMDvohrnMZ\n5H98\r\n=voZ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAJ1mTUfPXirCasEMT41n39t4pcc+gvUAenMnsbJE1KAAiAhvblSy30ozEki++cPYh30+rBtkV3MY3qd1cE2klx8jQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-36aa0a47232b95340577905cf72edab314e5b12b_1526646285896_0.1178793464375838"},"_hasShrinkwrap":false},"2.4.0-beta5":{"name":"alfresco-js-api","version":"2.4.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"36aa0a47232b95340577905cf72edab314e5b12b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta5","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-GP8puaxN2BfyzagV9mvEkU48AGw6HqRrQgMU6Z0a8EEdEGOIDgpWob8oD7azruNvwp/WhYLOgzWQomPqIAapJQ==","shasum":"d9e4cd433882452cf50fcf1576d1184345402779","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta5.tgz","fileCount":1176,"unpackedSize":8008479,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/t16CRA9TVsSAnZWagAAVXAP/3WFXK4M58wonryKOLxH\nZgZ8Dk3uJQ5grpc1DsEbm4UZSOPI1NwSZ6/PQmaEY5sZHuw74UID/dUZ55XD\nzrlRXk62W+YSTYJ8ls6GVirKpwSp48soX0EaMr20mH5IRA2JYNmaPV2HNuOU\nxFVs6DdozWECEc8U/iI1To2eBjiv1xF6M7DJQNxc3SJ1gKxGf2sdEdtV2I75\nwR/yym86X5omif94oThdUVDEs5Xu7mCnc4m6T2hU7otrOCQrhEIW9lBraTC5\nV72hgUiZ0APfCmjxDcZflu60MdUdKirG7vTHehPbiNsFli/xRTcFwqSHUuA+\nSSVOX2YrqLxsl+UM8y3dSeihMS6CzJPVhWSJBiXWfvkEZ8JEWgqijS8nchUq\nZtyVx0hrCEZA26naOPIVlKtUsHAMFeMzl50iOvCSaVXMm2TM11YYIIdgk8Ox\nzc/m5ntLJq9WhjNTbsJybTWzofXbKXvbJohyUHItocgnAw7vaFaytLJTts4o\nm7fBYC9QsKLWhtnO/IYM60x2JuPUEinw0UCdYQkKzc7Fub1zFUh3HXo0syyQ\nEyV82n710k2/1z4f1pcwV0u1tdpmN7croTsGeHycfv81iLdpJsOFWq5IHux4\nJjkktmAgwBeAbTQFM2P3bt5l+ERKvMZixRBOJF+xmTSQQgnSQjerb8+xN0/r\n/vKu\r\n=Ci07\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/EetROT+fLLQmqVa2zSMnBnnoE7xyQgTi+PnHn8ELNQIgMTjwOCa4EZYPLvOuZ42RFzm/s0/8Oz8OKAUVx7lzRWc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta5_1526652281802_0.23988375300339904"},"_hasShrinkwrap":false},"2.4.0-45f64c3562cdd091c992926bf496e0e693688f71":{"name":"alfresco-js-api","version":"2.4.0-45f64c3562cdd091c992926bf496e0e693688f71","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"45f64c3562cdd091c992926bf496e0e693688f71","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-45f64c3562cdd091c992926bf496e0e693688f71","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-qu0kM8QNJV3MlG+ufa08qk2KXdzf7D0IbETJGwu8iVKgqA+8QhyUlTWw9nqmf5pHKv+1lagPD33vfGLkXb2LGQ==","shasum":"137a18c1e5f18e95d890884c2bd7f068342c8c79","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-45f64c3562cdd091c992926bf496e0e693688f71.tgz","fileCount":1177,"unpackedSize":8008781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/v5RCRA9TVsSAnZWagAAxRMP/0/OEFIl8ZGGC9TTBUIS\nyHaqXoslrbd8PwV+PhkORvMfDMGVmejejrf3ahSLXqUcG5GQDVjHtmpNmHHi\nV3JbmnKcVCWomOHy1BMwjDRGkI3FNd1q34Rr4/I5DH0jmUZSV6Y2ecI+Np8g\nROMJrR1vzgZ6vy0J/MF+FEMEhiM04u3sHvGNTfSzV/YZG3UO24t47ORHnNpL\np/e2nD/70Kflg76am8UAr6skupvNjcCD1a1GgxTndDarmSi1LivONvdiMDfA\nMummPU0yfjPfc6C6lZBsSmmhpqB5xX0nPxdbkTridap+6gkQOZGYYUTaKgSV\nJKLbYwIfs+VnjzQH58i8x/8PA5LnPBRsbqTo1xKzYBwYucdpzbW9/3qUVvOk\nrf1xTcyl5ghsl8xdv73JcNMZGPjlp/DU4IC6UFBRXhxiWEAAeX5Uga6v8M6m\njlO3dmFJP2dgfAsovmBRioHNwPTbAcSN7QP/gUP8LBSm4VOyioRS+LsBuUkM\nFwavSp41ITzHACoYIQfMqa+dYeXci00D65A4cDJEEdU6a0oZ78iGbL6HSPsO\nHY5c7JoOpYV5MDet0OSHW/VfCRqws85d51nu+zCo7utxbaVRdk8pCflJFm80\nJbmGyvQOnT/XVw9qHG35bulhiSnuVIUBRSc3K1frpoyazF70UVwzC6BSsjK6\ny58k\r\n=Dp+/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoGmZ7BdtEMTlU4kdAnhQk6uJwfzf1vxTpRLIioFeANAIhAOPl2qV+7yFjS/0MlCK7KadMOCOvcSKTNBQMq2VyGDDH"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-45f64c3562cdd091c992926bf496e0e693688f71_1526660689517_0.014891628811792179"},"_hasShrinkwrap":false},"2.4.0-2b6c226654d7715ed34dfbd6f9b266adb4d85e00":{"name":"alfresco-js-api","version":"2.4.0-2b6c226654d7715ed34dfbd6f9b266adb4d85e00","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2b6c226654d7715ed34dfbd6f9b266adb4d85e00","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-2b6c226654d7715ed34dfbd6f9b266adb4d85e00","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-p4oiXlZPVHWOqtAlMITaokynGXk9CqnwCJD/ClQ0HjOOfECcM8CZiR3ckBhppNcizzlBu/btY/d2fREQXyahug==","shasum":"557c22d2dd2581928666d0776cdf84ca29ea0ab5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-2b6c226654d7715ed34dfbd6f9b266adb4d85e00.tgz","fileCount":1177,"unpackedSize":8008782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/w7UCRA9TVsSAnZWagAADXQQAI0WZmNE0aco9rbOMvkF\nsyKIS0wJHynZLXaoavV3sABcZuOaH9fpobAWD1Q/XBM0T3/qT0JLwpYRJmwW\nCInKQlaury7xbRG7em/AviBTUSW82kxhJC+U+QyHXOICjtG9z5GAWJ5p4tA5\nb6D+Hcs02SgUR7JZu+YHVlLOoWjpUEv8hFXRU2CKlryLUjaY9e42d4R0eY19\nvkaYhkRkBbXeFfvMYR/nZ51xkxOl3M9V4nRaXlgxHnLxVNUGkMmFbZFmVcWw\nXk/qGPPXXh12VnmiBgkUam2N/MIXnOh9HbOLHASp9oqLZEe5YtMy9DAQ1pL/\nGb4HxYG/BtNGgY8jWldu6I0mjEP7kqZVHsR3UUPwTXVRTptNS6YCba0NQAf+\nJTYNulrETRzFPgQPedLbXgGmnQv4p29omhyx4SX4+It/8RRHS6jXTbq1CXG6\nsaNmweN6BH9bD2IA85MYs+qLTJ99f2uyS+OB0Mz+AqETczzmc+rCTEbC3Swz\nwXTqpF97A0d6FtQXLxibmuu9ULtjrz2uRnt9sGVe2bVKB3CBARND/+n3jHrx\nWpwxGCiAz43Oh5JOqwCZsSqgyR3bImsUImWOffTFrrD9uI0/05OyTqOSrWUE\nLHcHT24DHwj92Adq82KyVXeoNqENK3jWldS+743Uf2Hl/2jQMaD1uCzF78hQ\npMh3\r\n=Q9Cb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHIHmvBcMoqm7RhdktGvGluHq/x4wScMLqg6zur3nFU3AiEAwxyXcIigR45r82Ws/3PgEoKObqAr24uf0Zk+XtJNgUo="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-2b6c226654d7715ed34dfbd6f9b266adb4d85e00_1526664915921_0.8051342749641506"},"_hasShrinkwrap":false},"2.4.0-5c3888062e78285627b1f05b5fca271cc0fc77e4":{"name":"alfresco-js-api","version":"2.4.0-5c3888062e78285627b1f05b5fca271cc0fc77e4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"5c3888062e78285627b1f05b5fca271cc0fc77e4","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-5c3888062e78285627b1f05b5fca271cc0fc77e4","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-7W4SMygWHIEAKPU7u8A/5DyGhsK2+dqyGN/HrDpIRZjUHVWtSXVao0C/Ei3LIzbFHopeNAuJavTJ2iknX7f+VA==","shasum":"933541742896e314e3db5eb10b4864f431084930","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-5c3888062e78285627b1f05b5fca271cc0fc77e4.tgz","fileCount":1177,"unpackedSize":8008761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/xd3CRA9TVsSAnZWagAAQSgP+wYGuwjUzS9A4AyCHnWv\n4Mxv08l79+e8L3H900ruzuqkkAvfPR5qsEQr/mf2VPz0mkdvZk8Xwyqq53B/\noziGzXO09BFHa5eUek2/MPNC8tlactMmOh2qXyZ1bDeZolfqqFUh4TUoxsAN\nkz2xe4ZNJwKl/m1xqA0KlHRovbBJCdndCeIY4bir+v7Ck9atsEDNiw2DZZQb\nuCz+6yBXUXze6406duOEnVNkhWM00V1AevzwHMLVqa4nUCuOnEOEpTfRlfj2\nDpx8J3zbTJbr9GHt+0oot0cHYpJQDc1tt8zrY5KmP9+w05I4jxAk7RgJGK4x\nmfYJZqpqBhVzXZ3uVRwFAf2zIYM7z45sJZB4B+ITlxOIukcNygi91RKUFBXe\nyRhygn3KW7BjkM87oBR3xQJ4zqhQjdyDV1byDwFqDneybFrdbtlLhvuCF8YO\n970hIiUC44XQVzW64sxNi97h62a9+gGTwmoi/jni53Zaut77gQgbzCmRdEIv\noYit7wBwp7CZuY2KH/86LeYYZhDuUESRp+NRlY084gKG52djNe30aDfC7JHh\ncBv4JjAbAUSGIfrlhEXlbcNXFAiagcTyvlnaq2pwowO9pXcyhNk7OOL6pgrw\nNVx73kheijJUESuXac9VcFsbiNRw+dFlQGgMAalabpEp1bQgWuZg9Xbqjwf+\n1SE3\r\n=j5PE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGHyo+0IGxjvfl1l/CsTT7NvCXN/vkV+kQDLcEsvgnPMAiBexsqw2se4fZpIFNwgzF9UEV5HwzQFg0uG+bBO00uLaQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-5c3888062e78285627b1f05b5fca271cc0fc77e4_1526667127633_0.7504790886149499"},"_hasShrinkwrap":false},"2.4.0-cbe2d189fafa5fc2c6e9f1b6d370faad9f6dd000":{"name":"alfresco-js-api","version":"2.4.0-cbe2d189fafa5fc2c6e9f1b6d370faad9f6dd000","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"cbe2d189fafa5fc2c6e9f1b6d370faad9f6dd000","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-cbe2d189fafa5fc2c6e9f1b6d370faad9f6dd000","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-TOqZvoQnskePEINpLBiC4JQL+ak8gBDIE16lnkRLiSjSmrQ6rZL6Xq58lkTLa7ysSVv+Trgx9+ie+KQ+LCgxfw==","shasum":"24159b5c44a2d1be4b35dcedcdb8b07445d67b1d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-cbe2d189fafa5fc2c6e9f1b6d370faad9f6dd000.tgz","fileCount":1177,"unpackedSize":8008808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/2fKCRA9TVsSAnZWagAATuQP/A6NbJQaWGUaSlpdGym8\n1uTnTVjyO+4TTydyw3r3MOISM0hPK7Pt+SqWUVWlmWAAcfhk/w3ce49bTTWV\naH1z/exmr3hjarYfes8AUUUQP4OwM+xFftjUjCQUIzvLNbZGZM5IeHiQ54aX\nmbyBK1oTdBte1vMX3mcv631EGEIL2IhHAv2abcIw4kuGz0mnvy3pFd5eJywQ\ntcHrPX8/Z+Ry8GlUv4NEhktBHv6QGMVhkAdhUqu7sGIVUC1t8GxJBeoj1zLt\nljOCH14P2TiZv73SClCgS5wvXkRZokIlJ4osqmbo32ahIXM9UBAeUIDR0+3O\nUB2H602ICyi1IDaBvdFD1th8v38qC6osx1xejJyP8s7gFbv8OF0BCCUWnk2Y\n7fNzijRaPzkdfRM6b9RFGtO9rb3Mp3lrKo6qimANgxISeeyx6uGGsHaAabKl\nJB7j0cs6szOSyEMLRlKzRYWTyhyb79l8ZK3zfCgUNO48kg4H/SyZnngHhEef\nYgWk7eORHuD0+JsAjgt8Y12DKCEaAoNZn2Xmu1kHm6gxstNRfNoYjpydcKMG\nwZLk41nF2+J5QAqnUlxTgXVr1XQkNB4WlF1wpDI2YUZ1NhAtKPwyyFR5/yr3\n/G9pUr69HPvGeGJlKHNnS3sAzGbJhFe0Jp/gAMqWDBvdtmWMIAMUWkx7lnqk\nlo13\r\n=Xv32\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaqXnfaUJY/3CgBGnz4aimIQpRYml7ipbaKNebLLHG+gIgLUClhEmp4KfdTM92toa9fUd6FMNgUwd96HThzRKE8Cc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-cbe2d189fafa5fc2c6e9f1b6d370faad9f6dd000_1526687690158_0.9629583557716845"},"_hasShrinkwrap":false},"2.4.0-53f0655bb278cd3111eddd2fb141a95f4b957ece":{"name":"alfresco-js-api","version":"2.4.0-53f0655bb278cd3111eddd2fb141a95f4b957ece","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"53f0655bb278cd3111eddd2fb141a95f4b957ece","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-53f0655bb278cd3111eddd2fb141a95f4b957ece","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-f0+/Lk1MqXBX+28PWBmQjhXeJVIeq2vo/cDsukCG6XIrg+hEAU2h8xkQCC5aKuh5Yz1LJJ7EsuSOuOF0x9WBXw==","shasum":"7f184f7e6e285107a1f729ad0d1f144afb8a08ba","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-53f0655bb278cd3111eddd2fb141a95f4b957ece.tgz","fileCount":1177,"unpackedSize":8008689,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbArOKCRA9TVsSAnZWagAAAPsP/iJZl6tG8XPCMzxrO3Mt\nZnrgpdOoI62V/xxkUGOrKRKvmh/nZuy23jHywOENsidLN7+z0ftgi8WofjqE\nUJvRj/ruNjIk93/qqF14a6A6m93u9HiVj0xvc1kiK5hDPkJeFSFhQYZFpVhl\nCW6PaoAHYX7MJrhlGNx231d1ubph5sWXYx5PNNIR0nvB4LzKIXou+nWsMJWa\nipeq3FPMryMQ/UzbyGVHYhoYe5gJFn0eGFe670UT82QxFwSN3mRHgtPIBypt\nku7c72UXQLgUuWtfRbQ5AgKRXc5STZKSArKVjG0v+YJXzaerVKahjtalGvC1\nnoXX9LzYMSaQrXQx1JebiEbZO2O77LsmxUDBJEyb5WoAcgxTEPsQjttktbVx\nN1hS8Ai/JpzuTlp76tvEaipOmtENtqXdNOS3Hva4Ew+CuhxAQiu3l51rf8DO\nYz6Nmdb0BvBTZQKAJYlreNI8BJVq4g+MKegCeR02oA2IxoKy/AmzFYbLXaB7\nrp2LhmukZrvHGE1G+06YXQx8AtZ9nBwvmo438FId3MvRatk1kKbWPjM5NbbC\ndinucrvGecVm7aJMeNCjceVaNkretZ57Ljr1kaobgQoNCv+4E8tvBJAT2Cdr\nhVAMqp2w00u6SUJJQ3ylrr/4sD3XONINNSRMamsqzfveySR/PdXKlcEnzDt3\n5QNJ\r\n=2KTL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2KrIoofJkiN6XaEHOqKSFKdBQMGiy1uO2SxcQa3GhxwIhAKGOjDUIMRIJ421GZjGjiyP61SYirK6KXvm/3gtl4OG/"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-53f0655bb278cd3111eddd2fb141a95f4b957ece_1526903689835_0.52209060080792"},"_hasShrinkwrap":false},"2.4.0-beta6":{"name":"alfresco-js-api","version":"2.4.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"53f0655bb278cd3111eddd2fb141a95f4b957ece","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta6","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ytEScVOdD9MeoIqkYwBHVE/GpmwD/0PE9eEEMZLzs/7r5igDhqIw4BrleIerfXh/S4y+U15fP0UFv++BW2XKEQ==","shasum":"f434ab468cc796daab487ebf4db26645d5b71d5d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta6.tgz","fileCount":1176,"unpackedSize":8008584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbAvXMCRA9TVsSAnZWagAAZm8QAI453qF6/fAQleEnyTkn\ncmFJ/3v4pBvjXXa3YQJDHT+XSm6e6/6Va8WU19V79FBw7v1wzdXqMqaTPaDP\nHWsur5DcGHyFWRdF8JpquEDVfYWKYBMd0jhXwkYHRehPp6hU8dlC0WIaHh8m\nnz3K0z17Mpbf+kBkdcYNGBb1zflQBa/1h1dJKnXYaXhHRoIpobblJZYuhCTb\nmbx57ktOQoTkMFQ2CyCm8SEoPqxPsoLjYviCld6uJzNCz2W4MGGGuqkWA6MF\nIavZmYH1Sjl02r1bODOkQSMAd8zLsNmKB9Daij0M0xM7BByHxGm2QyC4BA0y\nQa3pmgqr26W7lXUspr528Y8bnj84TyHW49oAVz41m7APk+MDRDfcaa8P7Kdk\ny6bvZq1PNVcbJA5paKJoQ6TBoTAPPfpM2dw/PCneYQ0df7fWAihEn2bugTMw\nF+PjJW1dzoa5fmtNLA3T3FqDOiX6tsMgfDcEQZl4Nb6s25ilKJ1aIJuWFl9t\n/SjxMVnhO3X8yw98GTP9RJ5rT4VU7aQVxhXKUQn9gaBC8vmfEhQ7WI06KL1R\nQega1VYy8E2B0VofmRbLJUGfbxDOBwICNWodp2B3wG5oRm04Q1ygeUg/HBQ/\n5DwgxaZ47sjPg0ZRzDy6p/dvzTWv2z4RYQQaokwm/wwP6iLsQXFoXNCIjfBh\nUBn2\r\n=stm5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+QVkwHD4HJeB/USe8H0y0LjIDhTm6fkno+Y8uG6othAiBQyAKfCdyp853NoPtRhzjYK3asXf8jxEJTgX6rbHz4mw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta6_1526920651922_0.22995952107788198"},"_hasShrinkwrap":false},"2.4.0-2dbba5b40321688b340f51a376e9a1114864e658":{"name":"alfresco-js-api","version":"2.4.0-2dbba5b40321688b340f51a376e9a1114864e658","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2dbba5b40321688b340f51a376e9a1114864e658","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-2dbba5b40321688b340f51a376e9a1114864e658","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-O7mKfyjpjPA1BpsEHZe/aF4JU7kUpmhaBu0zBvHaumoAAecPWwkLvz/tfma80UNNg32bJ/IPKgGl6ixVbuz+Ow==","shasum":"0b8dce466440bb2f361f53e4a4bc61a9095c5751","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-2dbba5b40321688b340f51a376e9a1114864e658.tgz","fileCount":1177,"unpackedSize":8009115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbA+NYCRA9TVsSAnZWagAApGYP/3A+DFivx+dvR209RHul\nmaAT4DU1PJ3Jejdn1ru1WZxpfZdILYQDQRlUq7/FCYBhYUWNW6mly4xe80n/\nVDra8KAED5BOYPEQjtcQqihm1Qv1CmbDd1A4A8TMxOeaRzv1xZN38XvHC9OS\nqOJ67gqUJNEVLA9Z0xNp6vo+rfuy8R7YxnrjUS5/NHvfk8DoYcHcUFy8+bUu\n/GU8CLByPqu8O/YzhgFhjUt+F8SiBozE8CWTzX3WqVufvhm492cFZKK+i/B9\n0BqkvhtiKstCWSW2/oTv/YBBV4Cie2g0D0n5OtMnulQmgmW4SBWoEayuD46/\nq2XghRBdMlknlxgBMX9rhMXPpJ18kHuFFCi9B3ijQlNHXco0vmsmyGW/Cmmg\n8sqmKhyXkcCu8eRqnAwA1Y1QynMgTQra/41rUcYOguV9Ga1RCpVPAKsDCYUJ\nFWN9Ee2vSfQPfIuQa61+UkShUFGTrtt4Ouu67EIVXWZeXGrNkuXGTH64JWCc\nFvG9+UHmiir27zQ63XsqQbKyirKK8ITInja1pp67BLFTH+0l33WjJmoO52dc\n0jQRji9l4Sb2/wPHDiLvIyYTa/PZaUv5a6wi3Sn0ibcHzGX9/Eo/iHOnZqKu\nUOROwxH43VcIaHZIib6TdieORFxcpf+cLJNg13NOqrkWQtV8viZmbeMoXSTt\nX1R8\r\n=DpUJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKGFXUkN+4G7mgmkxiotQ1CReV3M59kmEmthDNZJ7yywIgI+3X5+lZ6xOfsqyJuzLhRzdPaslQX11+m5k3bRXXetA="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-2dbba5b40321688b340f51a376e9a1114864e658_1526981455379_0.679716749601678"},"_hasShrinkwrap":false},"2.4.0-beta7":{"name":"alfresco-js-api","version":"2.4.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2dbba5b40321688b340f51a376e9a1114864e658","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta7","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-br9KjnxAP3GCxQLqghIuu75A5Xjhnr1b0MZfN6Ebbt6Tx/+qEpjF498uz0R7fxu8Ui4mhbTsvxKiaqSg5crb8g==","shasum":"ba5cf4796856f4cc47ce53d9793750f68edcb7e9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta7.tgz","fileCount":1176,"unpackedSize":8009010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCBeACRA9TVsSAnZWagAAtywQAJpbCTHieMtShBtLkJTM\nrpABc7/LDyI5aXHJPBXFNIyLvi5iQOY9ztftddrfqTcJhrBWn/5rM7S3eYMu\nw4G56ZO8f3jfZ/ZkU3BXOqHybcYx8dH2tqsyGlnDXvlcsUszOL7P6ghxlxPG\nQwKwpfm5KcrqXjYGJhgNhcCRwZuEuZtcJdRX7HnghZYwOhaU2Q0CKkj+SOUr\n/1QFxphkM/kLxQtpXIQyf/cbNxiVqpwAwP+lCHoR+laacher2Y5BOVMFjjZN\nhjQIhAf9HFQFRQLSUl5M0NEeyNXkimMVgtpXboRk4EsD6XtW1Cqe8QGvt/Qu\neT+LU7uKzKGU3nf40UjmJC3ukvo+R7URV1yiZGxCW2BhisKAs6jjKiH1DsrS\njBUuUKu4+mbc3MPPRNhNwPwvl1LrRUMiecVzDe4FC0bj38hJszL+vzpx4CHj\nXcs6z6ZgxJNrHr4G5sVQnFAY+NZTC0dm19lMxucu9QOQMo4CfIxnmXPGEcY5\n4l9IkEisI2e9vLN63QCbF6ENLinzVsJ0korYaLEpMVALmx37H9zp9M0RRVJ7\nJKSwhSWZbaFbIP+kXdJz6UvDdjc7CKvbciNRV9fgJoYqlE4l95+My545XPpq\nDAkt3pgonHfTsd8Hxr8xsx48WmoGO1bnyOtSQuKKdZopBomxU9+2Bg5gBbz4\nrfFu\r\n=D5Hg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIVT7NUzt+yNk6mLQFXpONYeiQ2oq/BWWHiCQl3e11swIgBU2aLe88xdFOnaeBQzuIaB5sW0p/KM3ciUmgpE8HHR8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta7_1527256960294_0.9476991031201527"},"_hasShrinkwrap":false},"2.4.0-beta8":{"name":"alfresco-js-api","version":"2.4.0-beta8","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2dbba5b40321688b340f51a376e9a1114864e658","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta8","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Mj6hWuA9d8GVIm5mULKf5pi/m6Tv1lf3Aq5xEFPPRx0ZQ5Ws8sJvotBfOBeHnEsHx1hc7FtR/2TWgc46vvO87A==","shasum":"cd1fa986725ff46477053d751f5039011a151164","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta8.tgz","fileCount":1176,"unpackedSize":8010360,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEBElCRA9TVsSAnZWagAADEMP/AzYjdt7FfJFyuAr59J7\nTpAbUcBz6f6piMjZvWC4B+gqu4/20WTuGRD8no9hNtYHelf5ZA9AD9jropCW\n9C/xnP9mLcn3RssYi8ATv1ELjSxfIQ5oUVGew0cK8swqh94ILOcaHtK6/hTA\nhPRR5wI+LwEJvucp/pTV8Z/j4W9FESKkk4ps3O6+tZLfiqBVKku551+1wmEl\nLN5B+UUFKIBDkfGgfYVeoFFAUTEWmGPQDEaBaEcTydiYWfQ46G/6wLxTeSUp\no4ZfznCs0geofVdqrZwPi886G/UhClOE7WDVLd2EvdaKobhn6EjjQoJ++VDu\nBPNL9heWZ6gwHh3bZAdO4K1quGe9fsK26f8Rv/ygnAJ8f1GAlR6E88AsM8q0\nvedDMHEAQJMXCRIQyHwZvErKEKsM4hs3e43iA+P1ZUC6So+YoxH7Lbr4XLkh\ntPSlqCNFXarJb22q3MpdqLDC39o4P8WBP0b5fxXfbrItuaP9QMEadswbGdAQ\nkyDoT/5wo4ad0KE8iovVclZZt2Gp/7gCVdA7di3ATK0cXalDqLZ4fSdbzv+p\n5vXiWAowNtDGrzL/hU/NeputfRcon9mqP97wE7RvROCH8XKiuCmiay6Ip0Fw\n+rjBJ+YEciiJwRYPrOdvdZ/4QzExZ4xzVMBwric50AG87ikDaXPHIxwX8uhD\nfmJD\r\n=6Nfw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICwZ3wLrzk4iQhTxPIl5G5Px3x4MHqiRJTTyZIMf+NoDAiEAlwYEoUMZM7ur4Z/L2of+EyDwu0utHmKyi2/+iOKwZic="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta8_1527779621230_0.5879608461638441"},"_hasShrinkwrap":false},"2.4.0-fed4e011ee70eb36b5e2015859e719153d70b6c2":{"name":"alfresco-js-api","version":"2.4.0-fed4e011ee70eb36b5e2015859e719153d70b6c2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"fed4e011ee70eb36b5e2015859e719153d70b6c2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-fed4e011ee70eb36b5e2015859e719153d70b6c2","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-HWA2zLbuRTi1mjIoaEW2ZSWKMDfOWcYOgplFZovQgXUOaFZuPJH1AQ7RbImq/G5/NKwe9AJSUAnkg5vpuKEBTg==","shasum":"2b696bb7a369c4ef394b11215ce88cdf35885f84","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-fed4e011ee70eb36b5e2015859e719153d70b6c2.tgz","fileCount":1177,"unpackedSize":8010650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEQ+ECRA9TVsSAnZWagAARL4P/2x/v1ZR6iZtqTya/B/0\n/+/CPveKTihLKSnoV2IKlLmywrX9MkFxAKHSOG7ZcaUhPpdBN2ahw01CcBV/\nwzgWpBPm+FTFty04uX4TdR2WOuVT5RvxmJFuQ+aDBXZU4fD7G4JMRCIkwAiO\npyd+fbycWo948R5eA+G0H/bYa6ldyfwGiFbHC0vQswxlqpJYQ8Xst8B40eD1\n1hFbvKBG3tKkio4mcyrVO7f+V7b34lmwAKEw21MbHQluzp3dtlVT9cxNJEJ9\nkIgqeXfFDmorn5PuxFWMaBXzdtnqTbDcjfGPTDnABfkYREOIGss7OpTPrlna\njXmxSou6EpxMdN4XKNwX5o9SK5/NcU3bITw7otgCOoH4mBz+IYsOaiYZngVs\ndV0MReeuvZypybubmb15Rf8phqoNDNPn1uy1A5qPfwThswj+0NWJ8Y2SMBKQ\n3vwXxsWVbbkrQGJD8wqf+snLTUKbISrTzr5akbJJ2+KFN7khHaG1kQRtYXt8\ntWR5d1ADhj+Z9Zt4MhnRGR9DS5JKky2q1lQE4l8VG7Aj3IeLgJMAAtl7leWZ\ny4BXShPHUJzaVMGZdpwkmFvFsgI0myLzh/T8MQqhOpQ/LvyOXX/yMgyoxAIU\ndl/olsCdHLc7jpqUv76gH3gQ/WgOMzq6XcUP/QIxtQVCb1xHS7N6Tt0Ft1PN\n0kai\r\n=48d6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAyoq9AGPQcL38rCXsEiickTfjka5W/kJ2MjNDkhu5vuAiEAh+5VxFhApbkwiH4zPGgKu3np/zppcA6h0Rx38c68zxA="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-fed4e011ee70eb36b5e2015859e719153d70b6c2_1527844740239_0.5030341912605019"},"_hasShrinkwrap":false},"2.4.0-beta9":{"name":"alfresco-js-api","version":"2.4.0-beta9","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"superagent":"3.8.2","event-emitter":"0.3.4"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"^0.12.7","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"^2.4.5","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n    + [Example](#example-5)\n    + [Example](#example-6)\n  * [Logout](#logout)\n    + [Example](#example-7)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-8)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-9)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-10)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-11)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-12)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-13)\n  * [Create Folder](#create-folder)\n    + [Example](#example-14)\n    + [Example](#example-15)\n  * [Upload File](#upload-file)\n    + [Example](#example-16)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-17)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-18)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-19)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-20)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-21)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-22)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-23)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-24)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-25)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-26)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-27)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-28)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-29)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-30)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-31)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-32)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-33)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-34)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-35)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-36)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-37)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-38)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-39)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-40)\n- [Error Events](#error-events)\n  * [Example](#example-41)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\nIf you have installed the Alfresco authorization server you can login with this option.\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"fed4e011ee70eb36b5e2015859e719153d70b6c2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta9","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-4SlaFerEucx+Gnusf4dwhEfrCvwWTKBxJm1kwe7eoKnPJO0I6B/Zx1I/Dkvvw4GVqO2f5WYoab+XGQSdMNyOng==","shasum":"ba4e12af31d81a65de74ff78c6de3a7ba2e5e758","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta9.tgz","fileCount":1176,"unpackedSize":8010545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEVItCRA9TVsSAnZWagAA4LIQAJd//PA6GguD849B7jel\n0HcyfXkyQ7VPh/yxrQjcRfW061PB22gEfFI7/GA5MjbeIac+c6fC2i+AYEbR\nurC++bGYZIM+dWNuz3Tgjgjq6awqDNLGToouzLcdPiNUxc5gj5QRtBMgy87/\nFz8IWbl+zDVaR1QyZN2h6gcqPEKI/Xzd5ibIq21wzKoLwvPfeV6hUfW8SPfD\nOhRoFfBcfzQAUDpRTTl/T12L6aqz55YGRn78VCqC1MKpsgUyda1AI8wh3FTt\nyf4MB6SM0PuN+qOiS9mbiS6BkHp0aw1hic9aeM6shQ16hFZ89XXxlDGYy5Fj\noLnH5LL3elZ+xu4GvcwH9BPKFbLEwY/e+UmEvCW3XLmgaM2COyJs86wgtTsx\nk/14wTIhph4rb9O0SL2Zl5phUQ1vamCzOjyY4c0FCgtbww+lDcNsQa/yKGDM\naRlN8gyLfeifY+efXwuFFE75ypWf1HV81YhYOyDVz+rcHctAxCtui0XYFoUd\nETOoinKL8nxDcaUdhXTUQ2B1mJyPz59HonFnQKA/s3KMK6eY2rCg8TAbBjfy\nRdK+6RiVn0LqwZdkw1fcniM5KvNAd1kuZnPj1MuiJyRdTx7VuWe0PSawzWw/\nXqTeqKtkETgm9+tmsD2lpSDYyhgCYBDBn8FfGUtmvqNkfKaPOVdGclryYKrs\nq3xl\r\n=rAUn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIER1BO/YJC2ImthpjdBFyv0Roma7IoT4ymKI3/e4Rct4AiEAqik8+o5IUNm0w8No9Y7mFXDX0jxUbbvQ80xyj2RZSI0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta9_1527861804737_0.8544661571900214"},"_hasShrinkwrap":false},"2.4.0-8ab589fe2e12e0c54c10c4596b036cb544484e21":{"name":"alfresco-js-api","version":"2.4.0-8ab589fe2e12e0c54c10c4596b036cb544484e21","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        provider: 'OAUTH'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        provider: 'OAUTH'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"8ab589fe2e12e0c54c10c4596b036cb544484e21","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-8ab589fe2e12e0c54c10c4596b036cb544484e21","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-4/uGJkoasbgrcwZVmO+VBpzd0UQZg2mZK7Ul2ICgubytAiLoRsx7HrBpEtfGZWLuXbMHfcDJsQrNQ0Lpm+lTBA==","shasum":"53de560216a6155cc2879cac5a8a6c15c4674714","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-8ab589fe2e12e0c54c10c4596b036cb544484e21.tgz","fileCount":1178,"unpackedSize":8555154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGV17CRA9TVsSAnZWagAAW1sP/ApVd3BzHpQkjLO5rVND\nESBTRI4zfWcQ67+oVikzFLkdZFjS9O+WCTttCZHVm4PseaZxjNYL43yFYENj\n52nKWkR9HsjgMs5TPO0WBzDg50RDZYZaKjII7bnRd54phI1bYh2WZ9PN6xli\nXL+Z627WtkbVhWKPL1tubkCWVhYNBcHHaiuD5hiX7Rr5EeCJCnpAcuWd22kd\nSQUqHOVVH+tdQ9QTGSV5KgXnS/9LxDZbmVO89DxPl13eghMaVipt+cvagesj\nstuJmg4zEezo5C5W+kqjg53dcQgqlOOhN7SX8kkXtiuZ+YAH3T+pReQVEMGA\nKosnt3Wxnx+mt8M7tYNadaaCCWcDyeXEPOW+OOI8wHz0iv2Hn/ziuCv0MCJH\nz5D0w3mm3NC6qdSPAqZWbXudc5j7BwckBdBQkr1p32KS0vTHB+GXelRE+OML\nlXnObmSvZCmiaxfVHwSNv1Q06tcOJ46bHxZIVS7JfyV41HmTHtbGN120RBAF\nCsEDMguwGrR96Z1urNn8kfIAb1kjXgh2xNn9cHD6+2wD/cSHrAH3V5Op8yxC\ntvfpZr4kbkB8B+/hGEgQGw3J6ixHq7z1eZM1s6ctaQ0NjV55YnvlfFfBbVtd\nXhQERZocaZBUynmm6U0WKBcZ0LkLyj9z+2vsy0z0LS/WsSkIoaCYbHy/uirU\nbaZc\r\n=2gCU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHMz/NzuVO+kXUrSFrOBCcohvfc1WKX0qR2BtFREiwc5AiAvMgPny0cYz0dVvevk6gT046Iz+7Z39LuQro65VakoaQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-8ab589fe2e12e0c54c10c4596b036cb544484e21_1528388987431_0.7733243339062608"},"_hasShrinkwrap":false},"2.4.0-6dcffbb2ca51d44830bf9c0a20b6c50a448b2837":{"name":"alfresco-js-api","version":"2.4.0-6dcffbb2ca51d44830bf9c0a20b6c50a448b2837","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        provider: 'OAUTH'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        provider: 'OAUTH'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6dcffbb2ca51d44830bf9c0a20b6c50a448b2837","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-6dcffbb2ca51d44830bf9c0a20b6c50a448b2837","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-RmYJ5hTGcQ7bEnLhMDMDzrGvTl3gNG8YQcLrZ07Z/Pw6K+7UnWYV6dnrH7wejz7oFH3adaN5UzSV8gmO+4RKhg==","shasum":"46fcd6b2920cb74c523837ae08e807739942decd","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-6dcffbb2ca51d44830bf9c0a20b6c50a448b2837.tgz","fileCount":1178,"unpackedSize":8555622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGXP6CRA9TVsSAnZWagAAWzQP/RA8HbGCJ4QXF1Aupxjq\nIFxpZ8C29X7eakNfrnr0oEhrYi9i7oWlRnny/pWHIV5uniCnuqzy68T5zAO+\nJK0snFWMUXMrhu5uPar9NHlVvTagdqEHCARFfPPeqKa2dEsLJL4dnGz8i89A\nGR2xnNiSJKGaVFVgBbXiK/0wC5S1TObtOiY3sNXxXr8IAKpE0cg6vH8gBEzN\nuoXqa9YPIykQCq67+0Kia0ILG/oSknz3bsg6oK0Mqe3lBdqXDKFSPgoSw5lr\n3u3zOJygRXHbwH28Iy0aD6L0nh1tE14O76RGBB6mIu8INvcMox9U1dFZ1WPC\nMR2BAva/yLoV6Dn0vWiBgoVqvZ6bGrH4pKJKMd/66JYJK3FlsJ7NQAGXFS+F\nqntDcP80QNQgAr4TUwZspNzNeW53Oyfzkx/rd/zgSUzbo9nuETnI+0O4q7/9\n9dJ7yPmMCr192bRV7NYmrwth6QWliOMPldwCLRTGp3BOCLYGK45pBGeHOxwn\nOGJId6dCF3FKt/RjnO237uSBuMyjG5CdTrsMdBGN4M0mKGWp0PEpP8sSM7DS\nCkvjFcfLyn/DQs9I7ls35XF1a9XMUMjC64JahthX++NCRPOfs4UOjTQH9zZ2\nOPWxNNQoVKGGq46/D2nipN/HdWw4l+nWiu336L8ZSAB7iq7yjzkKLiTHLwpo\nJHsq\r\n=V9c4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2NFUGsFXHYTj6fiEbstLx3JzBwTDZ1R9hR3eZuy2wtgIhAJZ7wRnhw4klrUu6elny1rnwvVSfdu4T1anCgAzN4HKy"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-6dcffbb2ca51d44830bf9c0a20b6c50a448b2837_1528394745639_0.6823870958798159"},"_hasShrinkwrap":false},"2.4.0-cab81f4d5e1ca60fa70ce9199e7ff028d43484d7":{"name":"alfresco-js-api","version":"2.4.0-cab81f4d5e1ca60fa70ce9199e7ff028d43484d7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        provider: 'OAUTH'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        provider: 'OAUTH'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"cab81f4d5e1ca60fa70ce9199e7ff028d43484d7","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-cab81f4d5e1ca60fa70ce9199e7ff028d43484d7","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-AaElRlZmzoNDgi9FWbsOZoBgkMr0M/SkPHERJm6qkoneB5gSsDa+VqwGzAKhD7tokSIXDcuHxbNM+zc2e4UdBA==","shasum":"651bf5718ebdf1ed502afa82fa88fec2f667ce62","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-cab81f4d5e1ca60fa70ce9199e7ff028d43484d7.tgz","fileCount":1178,"unpackedSize":8555876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGmJmCRA9TVsSAnZWagAAqjsP/3eCF6j7lCFTjhFqehq2\nfrsSTLlA2NKeWDZun/WI03iCuDhbve1z75sUGmmw3y596bloUidUB9ImcqBf\nK4wbFgdtfOLYq3UY0V3o7hSlbbHPMTuSsEC88GvGioJEf/97cBZG1uf+90r/\nwWD4QYUYS7narA6EUZfuiVuWfzw7rJE4YjGoxU0ptgTsJ0zDLZxjA3uAnvT8\nuV61ZKZMrA+hdmxQSw4A4j8C4UynW4HlNiFjYleYTyWxuMg+YjKkgDROBqXq\n3BO3ddS/T+qbLkXfwDfBedUBr+xd7N2EXSmwRmDnC5U3pC4a0clVyX0YZEt6\nUTxPOThwkPiCKJaOQbpY1Lh3pwET4sPy0CXKRLwpwp8ps3RbRqicHQkvMNp6\nNcIKjfCevM0Dr+T4vmDOteVa/o6AEX7e+YDeRkYfh0+PxUyFMx/6z5n/tKXZ\n5cHk0gahHbJkCXFWzCNyzuO5zLgySIOD2GqpQEKyn8Il259TSHB/RWGf5qTQ\nJT3V9sAvoP4DjOsBO6bpmzyYjP1IAJ/x+sdnC6JFHmerJQwzVF1wqat8y7EI\nu5TG242FwJvaoaxnWZGXuHIclwGlI6qUqOFAxavmuaKUfonF6ZReTCwVL1AQ\nQ3+XvK2eESbzg3gvdWl1CtmSH3WOE9i8MIAgpHPgtn2l6hkXI1hIKngX0UMt\nF4qR\r\n=8xdj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRvZ25dDcT7/w75KRHo7FWmwlOaV3cF98y3OXs7kZ8HwIgQDj5Vp5zr0auE77fKBGXfwoF+0XGWD8S3qOPsdiieSo="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-cab81f4d5e1ca60fa70ce9199e7ff028d43484d7_1528455781925_0.3562704194182098"},"_hasShrinkwrap":false},"2.4.0-beta10":{"name":"alfresco-js-api","version":"2.4.0-beta10","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        provider: 'OAUTH'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        provider: 'OAUTH'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"cab81f4d5e1ca60fa70ce9199e7ff028d43484d7","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta10","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-aWLLDJjmkIg68mdQKoImwubLKUPpjbYC6mwgqAf0TbQhOvi9J0bNa5vC69L2wFOmyga/QEUMBhy1UdgKkG7vWA==","shasum":"577002d9e4dea26c7ce51d597315036d27041cac","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta10.tgz","fileCount":1177,"unpackedSize":8555772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGo0cCRA9TVsSAnZWagAATwYQAJOi14wXQpBx3HcDdSpR\nxQw9GFdS4f4j9Mia5FG8sSSaFjucuXtygEuxRuNOcKyeZdmbXrVjcR8jsGyd\nYGTanUrhwcXt37wasmpoFytfqINyIpne27cmzMF3+1hqyhR97ZM5cshfC7Ee\nmKEqB0H8deWIb22pSF5SOJEXjSJEdYg5HaLG/5EPCm+04jDfKsZnBoNnOkRR\noB0+n2e4fBXgUwJ2Oed5iTuZN8RPGCOC/XYzrI/SOiqTJgGUdMhJ45vyxyhm\nM46a/mxyRKoRddKKj2OaOyMLiMU21oVHqzdF1obainW/0YjrgeSobYGu4qjF\n+TbtakjVg3wgkPKM0vLe3wLMBcL8TOrGynL31KuDNvKVQJ0OOAUpFEMdAS41\njUgLA3vm/KoJlFqbz1oTHFWxcPx71ltjlvah4BcV66yLQRq3gwXeAba2Rwgu\nV6xs6xKEvd83quj2+fPqg9IY2HeK+WKhzCaPdlPLSi33J0nmcA0Xz8dIXr8e\nBXzsfOGGNooWQGyGcv8TM7PlrciTngXAOEWwYVsg7kwm9IX3ixxSpp5/Mrod\nR1xJO6AJz63t+ponV1tn2AguVVNax4vd1A79q0TST9EslnI7OmZsrWZ07aqj\neYarfandktML6AZA5qJl2CI3oQf7LTeVaDVhbwpiwkwhHulxF9mqwqOFy0Ki\nNuQz\r\n=wqxS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCciwDLBPfi2Lpfd7CmqPehWAbIrxcygXLBhDlfxSQesgIgEYB7gnOVmE02YySgA45ETPikfBXN9PU9snTaabmV0EI="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta10_1528466715704_0.1481285160285022"},"_hasShrinkwrap":false},"2.4.0-beta11":{"name":"alfresco-js-api","version":"2.4.0-beta11","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        provider: 'OAUTH'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        provider: 'OAUTH'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"cab81f4d5e1ca60fa70ce9199e7ff028d43484d7","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta11","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-aSYUOufw2CBWBevGpr+J3VjvKx9dbQIVWx7/kvzppgT/4lVmVmN7hVieQruwK77RStd7MKoJZRBr0ePeLop7vA==","shasum":"225dde69db0b29ad10528449be4b11c37d89b144","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta11.tgz","fileCount":1177,"unpackedSize":8555772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGp4wCRA9TVsSAnZWagAABtsP/2ILfd1aG9tEF96S/U0r\nnkeYw78AywSFlCQ0F2oQ8B4O6TY1cEgR9n9LE/fCfGwWeIsiUOxwK7T8VGpk\nJlTttPVBWnEf4Yo9OW0VP906aOjQ/w/h7mXNL2sUPVlSwjE3Zca/I1Wm7ds0\n5FknYTGSueRUiuUkykCkKDqV4rvXfvZUiGli+VdzTD8ATr0Iu7d2Hd5Ff6cG\nMR6CffPZbzxfivo+M6qAWjv7BpiM/f55KnHqCZnKJDKrBOOY3Fo0m8OSsHyo\n+aqplvalW/KT7zu9W4Sr2On5Q77y2K1dul4eWb57io13BONtXjG8E+tc9GTm\nlmF+EI3mJTSHpj5DNknM40jWQbXTf8F9LYlbOrdoMuBOTvKMgIiJu1V2W2Pq\nkpOLGRUbIOFRZfCuOuJ3K9lZXM/vpKcWSYOISRj9rhIiJqvhTr3wAXE4Kj2k\nfsxD/jaBoA4rWgTAsegLGgN4S+ee7uWuFQPotEWfSrGiUOlXIdLvO5tFazVz\n6IN9WW7CoRMbjzo6izifmc3utvnbSoy7MMVxZJRPPB4UMJgfS0r+zHco2lMn\nsb+ZtAqu5gLSA8ZW9E5gbLyEppFF+RtjKcXD1EJ2mpHMTeZfh7ZDu9tGz8jT\nlum+nNOVXaMeYgBX3b3hbKAm3c/8GlMlLp7vPMjXTEz7LR+r9A2yrLxO6G6f\neNLZ\r\n=e+ZA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDfRYrtECRm/AKlHvkFIZYvKXeP1EEehMiHWzwhOtgMxAiAFiXTm0mgNGbYDXXd6GZcSgGlnQFdwBYC2VhL9VLgo4g=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta11_1528471087880_0.3070698683273194"},"_hasShrinkwrap":false},"2.4.0-beta12":{"name":"alfresco-js-api","version":"2.4.0-beta12","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        provider: 'OAUTH'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        provider: 'OAUTH'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"cab81f4d5e1ca60fa70ce9199e7ff028d43484d7","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta12","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-kTlLeaYPVd9bwRamDnmqgV3oFLIkeyxnJZbxK1OcLzCDHx2iSRNWBDHVenSOY/Z8rzlhkgCb2bnnb0fIPlcBpg==","shasum":"1940403848a24a8a6dec4ace0e4456b3b8cbb1e6","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta12.tgz","fileCount":1177,"unpackedSize":8555772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGp8mCRA9TVsSAnZWagAAzt8P/0TU56SfoJdu0oFfbW4I\ntkyeYHaU6K0pEqDSo48YjAE8BQvFvda7/akhBJq1825JXS0vgZDi+eyhIHhQ\ngTc0a2VwTwoHw3awujlTns+D9FwwpMukNQ69IwrFQRmbZKmxZRMZsdtwL+ew\n8Bs7RSRzJWHAwXuVVoj9aN3kGPA5MJ+gQWF2wDoOoS1U/5eD0mjWGJ52uSbz\noT2h2VrZ49tKWSnvr1O3QOnqS2ctijZn4KTWUYtkJ96cESwIfWbDrSdeAoGY\n/FtvMYDzFcyJtjBfC04XPQNCm9HxvAFajFFquem9nHnVlfVfeJsUVmks0PNL\nUThoA7Z5V1kPIDZxxLqY/XowjgwBKi1VPfduwqTqG0gzUaAMtnGN9jLar+E4\nnOEo1eTocIiDQ/ATGK/79RNeK01M8LXaxFjky2fAl48coB0Ja6xaL1a2l/ce\nFG3rCEEJqjohVK3k+wSoc4K7Cruj/YGfzrzDLvCP4sJkB61T9hQURM+KbTPD\nkO5mG2DVPeoStri0X91hbE04uG6VygVngNINFiZkr46lFl1mv9pgIiJeyCfO\nJbF/+W1Ohz26GTX2iYF7No6rUHjCvoM7TAirAgrgtEKgq25Ee4qKtdBpN+Nt\nJfaFvJrM4F1aUeAe+HdvZNz+fpxgUcsDUD3kuZCiQQzKK1hNyu2G7VENXY2v\nyYEa\r\n=OyMR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF2Kj0392r3wtmlHtKl//t1W5mJb//JpFY2ftpA4rv8pAiBhI3GEZy+yQQvr1iQiNGMBEyGRQGtkp1FXiMsss05dEA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta12_1528471333893_0.7424456723387234"},"_hasShrinkwrap":false},"2.4.0-a8953fea4ccd93a128e90177fc6671df523c2c64":{"name":"alfresco-js-api","version":"2.4.0-a8953fea4ccd93a128e90177fc6671df523c2c64","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        provider: 'OAUTH'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        provider: 'OAUTH'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"a8953fea4ccd93a128e90177fc6671df523c2c64","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-a8953fea4ccd93a128e90177fc6671df523c2c64","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-I2DJrTepvjYzAEptXupciIuMxjPKFFzBgYAWZR0Lj76hymdkVRDC3jRW2toDpdgGLEGXs32axlYqxLbRTL2Ktw==","shasum":"305b803e51d5fab787ad68a9a0a336e75b2bd0af","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-a8953fea4ccd93a128e90177fc6671df523c2c64.tgz","fileCount":1178,"unpackedSize":8556453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHpvlCRA9TVsSAnZWagAAwgUP/0FyeTiuD/RXyOOSoTK8\nE2XqDPjfPIn3NVf7CB63SNOF43yjVOuFQf1xHcvZMmhToLAwHEjQzrs5yQ74\nSBAtvRrrsY8uHOuCd5XaEKWMkI4PNjO9txpYQDuGB5Fhq6kRrUKQayQuBAKe\n/uuFTS+86mv3B0/Ny+qsdGw7i56hXrmSp88pO7LXCLpy7AAHCO6YhMKPEE6A\noF6Dw4rTf7TjS9B//jvpVEO+BhCjdjvrb+VhgagRC0yeY1Fj26HVW3MomEjH\ncMUKk0c+NFswpmJOQJKlghQvuynaqdtg8i5kXVYS5hCIsdLYhpzrezG9Jv6U\nYJ0wmnu7+7z+Q7XS3+2Excm8WyPOpEcARg+JpVN+kRxe6ggaZ33+/argd3MF\nz47MQqwXr7cwrfIC5ojTL0yDhbcjuS5HiiIcMzvmqPgsGPTcE1CVA+V58unX\nSfDJibcDYwNnCE3C0yspF8R27cBa5tQcyoCg5Yl/dog8ntidVFJ6SZaeOHvm\nQbBeBOJM4nIERySDPM0VgigIA+Q/zTxI41xo3X8P8TawSm2QXWRlBnWYQehJ\n8i7MQRbXLCSPpjgkrvqqDbGSedqXx5gOzcHbICyvOR8kl3+ANIvnrGdzCJnh\ncn08N3ywk1E67nxItkEiuOBrzfV0I6MHGvhCBge/SdJw9QmmtvySwWcwgMcS\nfE7N\r\n=XDPQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMSlCNwA+0bZigcYvioQUMtggY4GsXAOYTSMowDfV5BAiAC13VqnK/6d2hrYCpUrHwJLAcZ2jQkQm+qgycnyHOzzg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-a8953fea4ccd93a128e90177fc6671df523c2c64_1528732645038_0.7255381866278943"},"_hasShrinkwrap":false},"2.4.0-f2be5e0523b1be9bc7e88bd9f00789ea78aca41e":{"name":"alfresco-js-api","version":"2.4.0-f2be5e0523b1be9bc7e88bd9f00789ea78aca41e","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\noauth2|  (Optional configuration object for alfresco authorization server {host:'HOST_OAUTH2_SERVER', clientId:'YOUR_CLIENT_ID', secret:'SECRET', authPath:'my-custom-auth-endpoint/token'} ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        provider: 'OAUTH'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        provider: 'OAUTH'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        provider: 'OAUTH'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"f2be5e0523b1be9bc7e88bd9f00789ea78aca41e","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-f2be5e0523b1be9bc7e88bd9f00789ea78aca41e","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-wM/p3qd9LAMB7RWffz935th4auD5SVLbwkjapK6zdEiuW9VziangrQM3kMFZNC26ujjJKmUfh789yaWiLbzWHQ==","shasum":"374dc8cf5e5d4fb4f84b561dfab848223a414a20","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-f2be5e0523b1be9bc7e88bd9f00789ea78aca41e.tgz","fileCount":1178,"unpackedSize":8556453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbH7UnCRA9TVsSAnZWagAAMTMP/Aky9BlAPX394vW0Ew13\n5F2TvR/LESErIGrh1O5SgikNJdhwd6IlHA/IWmlFjZ2HKy3Slt4PWbf68CLf\nlJYcOla7H0qplLXzFZ1wrKo0PwOrrO+yfCJAjKLAVQUo+0IpL8qggSmToyXD\nwaYel1jo3Jhynj5InhzwxzfBoiZcEl59sh5zGI6Ax6N33dGqox1ReXDML5uB\nC9IuxnkqmVKKtM/HdeF8ZP+bBKE9iFVenVVoZT5WjZJ3xXsO6wTkjd/VMPpw\nC3sHDIeULVgRgdXNJM7aLV23xSQV7BjjDGoin7PKiOsXKM+I4ld+y6KGV5R9\nU82LUrk7MwqVz6BL/alN0grrOLzbsjrLZdaFaQ4ZlOdIej5gUNO8EHjlRb2i\nQ2b9F+s45tu4EorOdwiVsBJgiDSBMe/JLkgha6j62NmDHbcvYPfN7u3VEs+x\ne4voxofZqOO5XQcYVbisjkSnUr530jMDJ3zMlem5Nx/J5CAQVwIyhxwfrN7X\nfiT0MSZoF2/FtQ5o0uTQ6IpwBt8VdkW9bQABwvIpk9ZZz/2RSxFkbZpgIOc2\nQm7PME75de/8Vs5Wdi2smtzUz8WZ1qtrSxr6ztWcM14Yi3jIOFv+cVh5kg0W\neClaE8hacqbZ63BMnyzKwNocYiUoTKkdTGGfhBLulsc+mO5gpaBd4n6amzVt\nwLlM\r\n=ydr4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5Xkkh5YIsAA8QszCKmuBB+4zqelcRF7I1jkqQWMkjNgIhAI6bhCGRlsIGPXy6zhtoAal49nJF8O/nIe8YFB4k2Czg"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-f2be5e0523b1be9bc7e88bd9f00789ea78aca41e_1528804647588_0.7860263084043355"},"_hasShrinkwrap":false},"2.4.0-e972f59be4e8f2e6bac1fadd793432e9701d8c06":{"name":"alfresco-js-api","version":"2.4.0-e972f59be4e8f2e6bac1fadd793432e9701d8c06","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"e972f59be4e8f2e6bac1fadd793432e9701d8c06","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-e972f59be4e8f2e6bac1fadd793432e9701d8c06","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bNoMkos99FF7TIkTxbhEpCuRadagGywxpkRHNV4BUeOAsX8IA8o2dH0zwR6O1pAyJRF6bNfDI5Oc/RU6JvXXzg==","shasum":"d98da916e7ec7e9501372f3f23a8e45b07e9b8fe","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-e972f59be4e8f2e6bac1fadd793432e9701d8c06.tgz","fileCount":1178,"unpackedSize":8556808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbH7XZCRA9TVsSAnZWagAAWlAP/is4P0SjsO6qI4n2H4Nh\n5Nqi0fMmiAitwxTkYxkjUI+D2OJkP2Y+pyQmOOe0TOG/zNJ3DoCFWRehJGMI\nX01wGnvhcCTngZhx7pZ8c0/MN53Zauobkreu9JKdhthGvddTM39NBZHvZ4YK\nVhvn7qp3NJRHmUj+3H9a4apQFvlC5rpfkROZB1VrToxfrJOtEBMXi+jGLWjd\n+a+fajAgh7zwJoXzh06t2r5+VoA4JnZGkY0+WlhqLIu57nEUj/wxIjDnLAbY\n1FnuQBpATPecnDM90FG//kVmAo9GlVgoeDYHMLNYx+F6FwRCAnlqhF6bE+6W\nSof7rVAX9MeKQJC3PV4L85DZqUolUEX9B+fotgLgBBtAT37+2kIw5aS8kCFh\nz3mA/x8GsIVzCu2L7BcX7NA2Jp+yP8+v3N7fPDwgNG6cH6vA1aBeGfhWLXW2\nquewKwIaStUXCtKDf3jVZFVkobKeUN74PWaiJRUzRsMExaj9UpOJYUEcbIuU\nN2aq3OWZp4XYRRXtPk9gajK9IZx5KUomUKztJpPzET6IzslpK+gV3TWwM4v4\nO3D3MPFrGCMXOWvZqFQ+uZ75eL9eJ7i3jv/646YgiHFBfkJyJ0bsfxAU3Rsz\n0LiShudy8UgnRmLr9/ZmfdVTeR7mp2f05s1St4YccGB61k/1pdlBY7NXTFZP\nOpDv\r\n=T+Aj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBT8QfD6t0RCDWY+jEku8T4gBnRtANhI9iH3gRuOxSkCAiEA91TRwuu/HLpe44aPdzEuYg55MMKZ7gp3e8e2qriFrOw="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-e972f59be4e8f2e6bac1fadd793432e9701d8c06_1528804825222_0.6605191333441285"},"_hasShrinkwrap":false},"2.4.0-d78bd47d095d373088d67a4fe2aa3bb06c66c14f":{"name":"alfresco-js-api","version":"2.4.0-d78bd47d095d373088d67a4fe2aa3bb06c66c14f","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"d78bd47d095d373088d67a4fe2aa3bb06c66c14f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-d78bd47d095d373088d67a4fe2aa3bb06c66c14f","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6H80RmDIOV2DrWz/n7t4jzpdQm79rPpWolsV8tRuyJW3U08Nj4WSB8cQ7VYe19sLEZbKtRG3K/DE8xpYZzU1uA==","shasum":"5611441f3ca66bd86b7fd20fd7087ad5fb184048","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-d78bd47d095d373088d67a4fe2aa3bb06c66c14f.tgz","fileCount":1178,"unpackedSize":8556904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbH+LWCRA9TVsSAnZWagAAskQP/0JdwRdxlsqlC2hyjHBx\nNLkuKWOeLYDaii2whQ1MGKS4vw04H31fHeqjY2IUIIteaVTyVanCW96f2w7f\n3suwp6iPxPZS2O9fiQpkhDkceXK0TTU01NXpX1cpx9oxqe6tX0/bpMZgXR6y\nM+sckwNwd51AZlxRY4z9Pg6lNy2wVN+h1xqfrjcsFd0JlfYOzoIPKhjl5s6V\nNT3ACELvAqnogcRQYN6g+Mx2uCBidSv0detXDJ73cWNnEcYRx/aBYWDzpUfc\nVbShMOGGtSB0GOw3Sc6o6ux3MHexpbJjsf5ZPnMU/QnBZMfRoPPPTaNKCR3s\neKQp/zV9uiwWlkfHSNcIZ5/hCyYrTxVEXPYmThTacglTg2PySg77D+DUCUYo\nXuFZtWzg7A4yQpYnt33D1rEGJuAGMJxqKfh1RmSB7Jg/beszFfYnYhDlz+Vb\nGbz1MiqfbYVjJ3ViHsD+RdyX9/8FHKGNvHiGSTPzuQA2UDWJNZqGWVSS2QHR\ns236Uz8+K5jo+/7jABaKhUBK03/iCnprjOa8Deb4jP/YoOiULjai4npogwrL\nZv8lF63rCXuAd+SL7yjNsLLPzd8MHR2vA8PzI0C922tZOhGZfqZ68+1fJUMH\nYvZt5snJrqtws46N73jbuBC/X2WfDpLTRVyePcktHivbmfSgZUh0EGMMlK5B\nshZh\r\n=RoDQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGpduPi4IVuJPDTdAMhPDprpfrWjN4p54lJu18KM9b6cAiEA7SE0y6cxoA/xhIZwZsB0fqN5Nd0sw9PEq3znI/8NWmo="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-d78bd47d095d373088d67a4fe2aa3bb06c66c14f_1528816342592_0.12950914560079263"},"_hasShrinkwrap":false},"2.4.0-beta13":{"name":"alfresco-js-api","version":"2.4.0-beta13","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"d78bd47d095d373088d67a4fe2aa3bb06c66c14f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta13","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-8LDi2M5H8MKmIUy8DNsWlimu0ggNPRuhKuaeLzRREh9WS3Nfh5hZyCFbnTNaygIa32klj46V2/5BVZnTU6cEWg==","shasum":"e7f2de62026ee069e44f53bbf8428fa187b34b35","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta13.tgz","fileCount":1177,"unpackedSize":8556800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbH/vPCRA9TVsSAnZWagAAIjMP/0wXSGAQg1osTACpT2o9\nzivWFbNDlEqnkdq2uydnChrE+08D05uPNpY2aOJdJqArlWqryxeBXL5ao2v0\n0xotUMBH6z//AmnqZx/Adp/MG2WJ1NwLIlXmOM2bwDf/sdoqnxyzIabs4yay\nPo40y4IkjlXSQJtBOR9DwDA9PU1ZnTmwpcKXoi1GHRPRF1Gp8rPcyXLfEhIo\nKFDkUDiGkchG/JDFVQSi6XBPtnn8ck5ARaYCvyrSwbgDqGMKrNZzn/i7RTgc\nzHNKx7boj57d/14VmumTBNhKv4xTue5pvBqxvGYDJeC6BHofYLiMbUhc3waQ\napZwEEDKGwC2rESBSzhi9wENW4UEwE5zrXxCgf+cNxzxHZLmdFaRu6KZx3eg\nclCkl/r5gSRvlrb34U6BzSWsoeg//O/Dgi9z34dyYGdxMx7WigGHPa1bVWCV\nATChDE1qE+fdtA6j4DOOoGrp+X6Jua2y+4MbNQwbyY8QEuCniFJifcVGCu38\nWQEPthxQ7o05YAE++P0KXEL6uiL1tU0qo0nb09rkBI46RMckIxogpwYkromR\nVO7EaxtXuDLeF05dWU5PyMXTIpDsoJu2RwhDqelMUgmgx0Sy6YqcJ+5sHsb2\n4AumNDfqJVTufGZlmcJiKleEEH+GA2mNohsZK0rp/b1jR/hj4S0qBT+MQZ8F\nkPEt\r\n=wUcc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFC6t1p6C9aNjOimbEvAZRi6One+37l0fHD1igg0nbvOAiAOsCoUA01v2hNeECWCtY7dbjr/9BYqwzbYvzmndYW6jg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta13_1528822735050_0.2461630062747444"},"_hasShrinkwrap":false},"2.4.0-beta14":{"name":"alfresco-js-api","version":"2.4.0-beta14","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"d78bd47d095d373088d67a4fe2aa3bb06c66c14f","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta14","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-kv7lqpq/a0+TTggICvd4/KUKCnHFKZzIHnSYp2ZawdQwLJtzHy9zy4pKFu77Ly20Nbnw8z6yYgAzoyIETJJKMQ==","shasum":"bca01cb2388de1e472b987817c4e1bb9b2c32c1c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta14.tgz","fileCount":1177,"unpackedSize":8556800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbI8cJCRA9TVsSAnZWagAAkaAP/RJmV5yJJCYCkId1u6I8\nDKuwJ691I3HgvmGEw2pxOuMTGmDkYQm9OZwzZa+TMtrC6N4LQBBhDx7apN5Q\nbMNfVE9FIBDX7vn8cmheWfFYTN+zusVFB3WY3K0MIUYYkK2KspXzNW/CKeGq\nCMWGQUa8MScMtSZbSFn9jSHqdM45PuBlrZveyDtDsiT6nXy+9nZ8Qfmycb03\nfxlxiQ0SS5V4t1hN+ceMjyZ2okiWfdbeFeco2PIWrg0tczY20S1H1n9g4oTQ\nvdd4exd33333lQzPmQTaq3nVj0JvHsX+yohvsh1ZW8ICUwIuVu61VVTgZ8gF\nDrC6mF7b2Ea0Qn00KMNzkX3mk2ovys6oimrUOQqxsi0dY/FAZHQf6oQa56E0\no1POUztNsvX+WV+AJ4Uer7/ncUcKzk5xg/G4cl/G8t6PTLYO4Hr2SX6GZv+9\n9NpL7hR3MfmMTsRsHNhW/yZrJEQ0jZz+p3EzFk8xVB5ESHWanu7+3wmHZC8d\nYH4ikOxb36cxk8TrInjGU7jpJJNEfIPJg/l+cBsZED9rcz7sUrrGxhyRY6wg\nlMz9GQL9pXSe637W4yxylBpeGoRSVwd5MZG8ofBU83UXSXOO8IuCJOHJ9QyG\nPABuHmqw/xNJYg1V59iZL6HpdsTEZ8/x2NeVp06ep9Y2jVVWAq4L8BoD9QOb\n8Yse\r\n=HUH5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmjXdMhwvgkQ1hA2nQy3clMuxT+wzZ2K6W5KBem5RGkAiA6C943SNNkzwQgJjSS6bZKWWpAd05k90Qq5vRRPLNx1g=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta14_1529071369266_0.9809075178205355"},"_hasShrinkwrap":false},"2.4.0-b37294bb45b791f7041ba24519bd2986a1031771":{"name":"alfresco-js-api","version":"2.4.0-b37294bb45b791f7041ba24519bd2986a1031771","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"b37294bb45b791f7041ba24519bd2986a1031771","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-b37294bb45b791f7041ba24519bd2986a1031771","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Jc5gUYw30LincLVjKU5hKp9sNNsrEkc5xiJ3i9HeqHauJODlwJ6t3TBuLfWcytCP+Up3EHW5lJ1qkgxxrxygbw==","shasum":"e39cbd28a6c9c664772ba48003b423abf4c7d7a2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-b37294bb45b791f7041ba24519bd2986a1031771.tgz","fileCount":1178,"unpackedSize":8559389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKTEKCRA9TVsSAnZWagAAyBAP/R4hqRO9XnIWsfyEt7Bn\nik3zrvCsvHsHadui105f8aChmPAB/zmdNSAlUbPjAtyB/BYUx2YoD2eMdU3x\nM5qfRT/SUj6eVDc4JKyVB0OtyTvzmkAwob8Rk81qb9E9H0RCfnxEQkYs/gt8\nwtJWC+VlwMZULsLk7TbcDw6ga00VEzfCRR1zfKnCUasBMnZBRav9IHf5kJd2\nkj58NQB4e9oecLFGqLLdHXk5VbG0lPTat6ktG+JtWPVdvP9TSUNrv6uxmkFQ\nMGf4O/sjywEvUydzCl/RjDDM0PX4nBZYnJP10uvAB5IjJme2VANPbu0OuG84\nKzkmRq3whlgvvOYGFKs0qMyDwBr0NApdLVimrr7sCYrIwVnFFR7TDM0GcN10\ndaLoDH7mTAQhQzLFszexlizQkb0fZyf6miJqzCiGGOJdq3BhGpOBhA1rDLLy\nRus170Q+U/0uUfZl/cHhoDt7sHWdTkQi1to6Yy+dPc9+QiVxu4uqnSjGlbRi\nBT6//wS/z6Vdz7dQFNjDtADWUzoqptz2cC8LweA+nBhGjrozMnBrqQI2NXh0\nh67L9/CWns5wVXmNFdDoKs/O3CY1yf81mwONap3j4w7Nm+JbFsSo885+jHZp\nCWZXdqutgnpBlNKb8l0NwZq0b/D+XR8oW1WerIQ1E+GZm0ZIplRNWnlb8GV3\n+Wqf\r\n=ysA9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASsDP8kQ6rtqsViOrMF4JRCa8LzRQcPjMSHKTADS3pLAiEAm4mgbis3SeJcmstG2XTWdqFCivVbWaSlx2e85A14E74="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-b37294bb45b791f7041ba24519bd2986a1031771_1529426185781_0.24745602458055616"},"_hasShrinkwrap":false},"2.4.0-c8369a97c208de7a8b0fdb32ca24993bf1ee8e3d":{"name":"alfresco-js-api","version":"2.4.0-c8369a97c208de7a8b0fdb32ca24993bf1ee8e3d","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"c8369a97c208de7a8b0fdb32ca24993bf1ee8e3d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-c8369a97c208de7a8b0fdb32ca24993bf1ee8e3d","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bTL9RX8qT64lEtJU9J2YfYrZTcgv2+QFR9XtUqAV8YRVrEXkg0ATMC/8VXSQzGGlxghbiTRO2c1COIBoA/nHGA==","shasum":"fd455c77e69f96b217fbff776041c34980f50b5a","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-c8369a97c208de7a8b0fdb32ca24993bf1ee8e3d.tgz","fileCount":1178,"unpackedSize":8559389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKXrbCRA9TVsSAnZWagAA8OAP/1mHvM67e2JWBp4Rrzwy\nJspb+nyIUfGDQW/55763jpxNjdpAoC957plvyYLZ1zUF0JBzvMErPt4JL8Tm\nspH8vDalEZ6/HCabdJ0SBDix3/WaPvqyuG/FPqpTWs+hidbwo/J+egMi7DN4\nYvN7JxFgTMV2uCcFPrGPeDW3WYYNHGkmIRgMJYXoQyhJ1eZkYV6xCp4rMGDH\n90dlFbMe6gNX0sYeA6E/bcKgQSBRBPsFaRqq4GWCEsyKYBrWvZplNG8A/0am\nxLo12VYCI8uXk56zyQ3XD3QD8Jsa/PC9xBTEjgTDGWERFxvPs07h7+/lRcva\nQvDOsLERx4CBBRvSe9JOGOC28owSyZ8neMHH2aR5HcC3pXjZxDTYFImR3OYC\nUaUqpUNBFfHiinzsPOUt/hlrj1W5BODs08KP7NXA8MyKfj7k/uTOfogKmFDm\nOpm7iY3TAskHCL63zUIjiwkm1fgHQFyBiFbDf8/wrpUe07LOWtb9QfHLth9M\nt7IVtNEsyYMmR/HUKvMHE110Un5Qvtu3dHVrU2Tn87xJry3Q5hGediVjz+GJ\nTR2Zm9jBZL9WPghFlXSynRabgSvSBQjGP+Px+wrVqzX8GhEKuX9y9LzmwP8x\nq8fwdoatioxAx9R5uwXAW2ZcVr9kqzjsTU4fgzPT1smZ7MQeEWmrPO/nqfxQ\nf6Jt\r\n=4Qll\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLmYKlX8SM/SQEF7j0OXt143DKNIl+fG+nVGcBbpPfMAiAqoAJTKdLovKnwcuD5avzJrQV8Z4rvcFr8SmhoH6GG5Q=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-c8369a97c208de7a8b0fdb32ca24993bf1ee8e3d_1529445082995_0.5525079901711716"},"_hasShrinkwrap":false},"2.4.0-31ede1dc5d8f95d7184c1cf944490883f4982d67":{"name":"alfresco-js-api","version":"2.4.0-31ede1dc5d8f95d7184c1cf944490883f4982d67","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"31ede1dc5d8f95d7184c1cf944490883f4982d67","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-31ede1dc5d8f95d7184c1cf944490883f4982d67","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-tassYFxqiNGK8DrXIkGldn78FgaMBD13y8v3XsLv2c8B8ZU4mspXNNKxy5vQSYqZZtAmWBMT24KdQijThbZoXA==","shasum":"a077d333a982ef525f6f3301208b72a12f2a2cac","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-31ede1dc5d8f95d7184c1cf944490883f4982d67.tgz","fileCount":1178,"unpackedSize":8559494,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKYJ/CRA9TVsSAnZWagAArxsP/2hHnuWIRPairTD8i4MG\nSOcTZl79Lvcgf+hLHusN9hPFkK+t0CoZbfFU2AEFlOsdo8z9wSoriV2Q287O\nEQ776x8IElZ/O+XDu/UwuZnOt0agz1zcmSMO9jAkkul2timn3ciigC5EIZ4D\nCKKFhDMEHhuHJSWIqctjga3FzppdjG8I5EuqQ0thX7n2b/+s/6WlB71GMPlg\nJWwzFMXz2zofJoEMct7TsAjnWduT0hbcp8cClWowPJc6K2XZ8/3olIgy3hXU\nXC2+cTe3dA+emhXf34yKzunCKdbykUEi++gxxVe5ZGLebVSv/5MWGhcEjQ34\nvhKHH5/9pulmXDohCt49PKj26Qd3/Aq+PwBgg7P5+0fX7HyiNQQNbaC7vrx3\ntfDpFGgDktB9bmvPDi85a6nkjzLCHmaw0rp5lYVDfUeIrq56gyDotUCaLkic\nuoduiEePw3kGxGrkMkbi/WAYed9toltS6XdsKWSH3uY0vqThYF7VYCAw/wCB\nrCTYrVEyoIk6EXzuUmu/pMzZaV1Qjgyj9aXIMhNnzDZMEq426ZGqGfH+lteS\nadhJ2Fadm+KetfyaoNN1LjML87ODpz0kTL8jHBpNxU3jMd38roj54NDvbCiy\n12wxmo+B5oW2UwlsRp8xXQdvcBnFkajEWlr6UXRcSsjB56Eur9QpUPvM6EuZ\nYcMy\r\n=+vWW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErQ8YeW6jYbk2QvUsMMDC0oKdW0VxhvQmUwa+y32mKzAiAKN2q3zweY2xHFicSgBlWgQ0FSCXWUQbOQwUhmgu6s1g=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-31ede1dc5d8f95d7184c1cf944490883f4982d67_1529447039388_0.36013946127757435"},"_hasShrinkwrap":false},"2.4.0-868581f930d784194f0e1f3111d9f16a69b102a6":{"name":"alfresco-js-api","version":"2.4.0-868581f930d784194f0e1f3111d9f16a69b102a6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"868581f930d784194f0e1f3111d9f16a69b102a6","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-868581f930d784194f0e1f3111d9f16a69b102a6","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-arkgMl6zcIYg3U4IDcYxSavivDhREKCS9QSg/UI81AI0lcxuN414Wr4Lw7DzTKPar0HceycHHo9rkHBVOg7abA==","shasum":"29b8c0e76bbab2f5188ca3b06374e04f64389c9b","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-868581f930d784194f0e1f3111d9f16a69b102a6.tgz","fileCount":1178,"unpackedSize":8559474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKgmgCRA9TVsSAnZWagAAYJAQAIoPIEepLn9SimbiqmCq\n9IOGyrQoGITAEdnXQucN3b7P6fnBuwc5esE1dImR4RKkQEvu+kvUzF8fxJej\n7kZ/WacHKlVPxIcoI5abI0M+Nty0K2W07vK9TFmIhQMbtKvIiUcUprIV4NN4\ncjsKrsOA3hE7Sl4lpIeIJloz/MmCPsDnBdG/9xeYUY0W/q5QkEk8+T2+eTUU\nS2YkTj3kbJZ1wQoQ48zGywzglkJMKm+wW5quswozjyMub2pa+oioe7y11m2R\nn7LYrEzlmFz98JP4fhUHsCLfEfNpuE1lINoAmdOzHgkGwDovNpuVLSDlM067\nP/ncvlwQ23W9iBBO1T75IH5kjqlwqxNMaYUaghNXfbU3gamUXS+5OflWNPDB\nNU8px8RxV7FKPHsC8JmOQoV7s8cAibiaUAUp7qOeRAcvFiPNVxbGFE/kOkQC\nullzr4pjB/YfIqfZAWrJAyw5cBdoxLKFw6s82xc7H3Mr9m+FV13bmcp09wlF\na3yOQJisi+XQLO+ppxEMXICwClWFSu6h1EjBzulakEDt8YELU+R2rvbK2Mj2\nRoemdgYeQDwDY3QVeYX2iWsoaI0u4pZbrtNwnlCqzfuvfeKFtvFcsPg7mqgn\nWDsE4a4VVn8ZSkDQIYLZjugUuu3AoPViwlgb5i2y16hh3UeeznNBzacTBbYn\nR/BU\r\n=bcyz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpqDEZ1H9ihqoqBeTKzRnyUphfYM5yS4wK07iXDLvjGwIgeTg3lyrmzzqOfHO3w/vB5WVKQnottgY/toT14p/AJfE="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-868581f930d784194f0e1f3111d9f16a69b102a6_1529481632025_0.008683342149969464"},"_hasShrinkwrap":false},"2.4.0-e4d79dfcb472c8c27b0d32cce4cc43c00ff2371a":{"name":"alfresco-js-api","version":"2.4.0-e4d79dfcb472c8c27b0d32cce4cc43c00ff2371a","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"e4d79dfcb472c8c27b0d32cce4cc43c00ff2371a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-e4d79dfcb472c8c27b0d32cce4cc43c00ff2371a","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-IhbXL+pt7SLv70quzKv0ycpCzChWNjMmqaMU55lg26PP9ftOOY6Jb6LgWscirN35pcv/BzQt4KIByYdmotlDpw==","shasum":"9f3a5fdc79fd9949562cbd38ae359bf6478884e7","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-e4d79dfcb472c8c27b0d32cce4cc43c00ff2371a.tgz","fileCount":1178,"unpackedSize":8559474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKgxvCRA9TVsSAnZWagAA9IkP/3aFZCql06/UAgr/baYp\nEgtq4iBBLnSKnj0Kw6KSJSI/UvQ/bNzF7OU9YoU/ITl1r7Gjmss0ivsTs5Oi\nMHNYRWDcfgs6Sf82YyzOvajkHPyYQn93PQfK/NE6gWJ34LFbQh4Uk97DjLUd\np0gKE5Qf4l/V+oXt4mRKYXViASRBsAWhLY6mAAlW5lSX3qRc8grt3XsAY5Yr\nKfsbHvtqfuTbwo8R0itMCT9z/dBklGcyH9QihvQDjao+mmBk1r2VWpKNU83A\n8IhFu7yqKQZSSj5bBEcRY0G4oYE9k/kD33sMa1hnw3NNefDL9B42gfRNbPRn\nEANMUXoVO82vU0NQ14jXZ6DOEdN6WxrBigvORZnpGyKTbbABoo7ZnzZnao8i\n3EVkfgiaaF+5x6C70UrRXLfh/gLhq2yDVwVaAeG2QRLvESrumw/7nQAbQPdE\nSTJ4gqMWAJElNi1Zs2+kjVRFWm7RTEY6E6NzNhUK+9G+msrMdcGLjuf3LGQ6\nXUa3sEd5KV8+J5mTsUZeOiXxGBK9JnQFvZ13EjdNCJWNlvZryVTk+d40adw1\n0DaMdWxAJcQa1JcFCvDL4d7t2GS7DGtzkmuWCZI1BJ9Qrooj/USYCzC6vwms\nqsx2w2ZTer2kQ8CxAb3DnOzbJw1Isc+0BjWvkJSnL+n/BcNVX2FHDB7TVm1H\ncKJR\r\n=GTcD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC95K45IAWIsPTQZYNE/QSL7AU11Gyabmb5FDyXWa9N6gIgdplf3/OrdfZG7fyY7MoU8Bjo/b0XzCw1ZBDdFojypXc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-e4d79dfcb472c8c27b0d32cce4cc43c00ff2371a_1529482350645_0.4451150969806501"},"_hasShrinkwrap":false},"2.4.0-1154af15fb6aedf7997241b762020593ab911d3c":{"name":"alfresco-js-api","version":"2.4.0-1154af15fb6aedf7997241b762020593ab911d3c","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"1154af15fb6aedf7997241b762020593ab911d3c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-1154af15fb6aedf7997241b762020593ab911d3c","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-iqKczflZNCfTJ9cfW09YlPEXTyyCUUqUXrbaKo5eszX9aPbM/rSI1+/XVlCaSm0GpOfFkaiCxc0vJrstrKVIxQ==","shasum":"f5a8e8990c8f8e84360beb8892f45056097f1a77","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-1154af15fb6aedf7997241b762020593ab911d3c.tgz","fileCount":1178,"unpackedSize":8559468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKj8RCRA9TVsSAnZWagAAdagQAI72pv1QhQ5tHtEmpekQ\n0MDOsyx9dCboBSPK2fD36tvn0BL7N7zqK2PDUoy531ioSJQBReFaEdF6S0O6\n8/1+gPGDhWbsA2nOao/TYLKatioEiYTX3k8IN5zA/e0PFqkxPURECH94OPC2\n6KkT1KUpVnXl6PYQ3YQp22XLD01teErm+Xsq6UTbuR+jajzKuxRpLCxo4S3n\nIaPKB4ImEfwRNir59H8lZctKMZP34BUbocXbK/IQgIC2vx9vgRKjjzGaG2RJ\nqZ8Alr7H5uHS5jNLjaYW1aXKAQ9hbo58wcbyOxmhXoHUQkoQkwtS27FciRQn\ne5KT12BUXg9yEDEj8sxp3KTXEOm44FRZqjEjyVBL46EcC/VMVR1oI9Yg+7Uw\n6hDd5BsmhrBGEmaLgV1xB9AkFWD89jGX5CxZTfb1MOzQntjRniSWEoezkoTW\nz05PIvATajgpIS9vTBbvkFDx0K5/xN8w+CiSSRTKXQ/bGrfjveFHPQheZ/aN\nFJ4WTyTs+tt4fa8CWSoXaOsbsl2yAJkYWSesUIlGsiLwiabNL7jm498a91Cb\noMWbC9sY+uXOYnTEURZta4kVPEk5P5So0vITh3rn3E38ScdH1FoULFu/+cpp\nu9nBDr395xt6pl5ohPKk93f8pQFmSMuCXjI6PyVsb9qTbnh5xXwWFcSJem8X\nhJHX\r\n=vfm3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN3Dwx6i4+jiK3DJ+2fLmo8BQFAVgCXhAwLBicLYEWUAIgaGcQU+kGTLI8iZimPd5WDoT94uCnwDDFe4kLxyFCJ6c="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-1154af15fb6aedf7997241b762020593ab911d3c_1529495313268_0.2034077664341436"},"_hasShrinkwrap":false},"2.4.0-2db3d3873eea5f90abbc160d2b4c654ba95c633c":{"name":"alfresco-js-api","version":"2.4.0-2db3d3873eea5f90abbc160d2b4c654ba95c633c","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2db3d3873eea5f90abbc160d2b4c654ba95c633c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-2db3d3873eea5f90abbc160d2b4c654ba95c633c","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Ptd2oe4TXRhDLW5lOB/+xED2XxaHX8UvfIg8vMf6gMpNFoSkJQC++7XdbOAJfQoR2263Sve3OyhGHLUq3+3Tyg==","shasum":"642da0bf3c0dc5465da68f924a50fdc6b60cd05d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-2db3d3873eea5f90abbc160d2b4c654ba95c633c.tgz","fileCount":1178,"unpackedSize":8559679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKlFECRA9TVsSAnZWagAAlSgP+QFzoWSDBc193Exfs+Sr\nYIC0Y+ICmTO9+g6cWb1TaL1LeX6zON04JEl+Goy88Cf9FRZKrQyWvaXhwI/A\n1SPqkCY8uOP3e8UsNeYRcvK7T9TrGZZX9wKV64HuHZQ0+cmNQO5VNtMcOFT9\nWaYFEKUOxJ8WXAZXuRYFVWlTkrQWjU+RAIQcKlIL30lv+BLKGvv9vicpKutx\nLh+AwQqK7RArEp5gAKBJlUYUDnGxHp7oklh7cmuaqhfukABXPB2DVTqDXhpN\n8u4MZcCK8igCUq5bJvPXTnnC2HabxR7XHhwQ9i8lWOZruXbHjCsl3fQwNyZe\n1LLWScP3ybmLfrjdpEkoX2Rh3XxmtSO4RovxEnvsmT9sKKTSWoLVmA1EK2Wj\nojMuTEqOq6zuhfRaU58BYH0pu7+IIy9bFNS83nDE/GetzFr30dcYOvCmEBkX\nT4ENc+bCHMwN2TICW+rarKrRvyhZlLbBN49saawbYAzKm62Xs54L14CCfhIb\n2x92b7sq2bAFr5TRT/nWo+MuN9gGNF5tqo8YPJ4ndWyeCE+/ZTO8NM9X2y/C\nKUjCUMAg6tIjTWt/A9vQ0cPmF/u/N2UI56O2fq9U57l2PLFNc89nrBppgfAr\nIgSDEs2rx04eGLDaJEelz4aK3J1+eXc4Z3KoIbvyG4wWFD/k9Wwcc2rEckfO\nOw5H\r\n=gMiL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyisk3bBkrYCNwIKV9ghPY31NxGSYwRvZmKP83XbXwHwIgaPFvhSGwg8bDMdX6kmUgH4NhOf/HwjnXcpI/2BGLzaQ="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-2db3d3873eea5f90abbc160d2b4c654ba95c633c_1529499971864_0.03342851268113711"},"_hasShrinkwrap":false},"2.4.0-ab3e53e346490fb1b4d8b48c8b75841e7d0927c0":{"name":"alfresco-js-api","version":"2.4.0-ab3e53e346490fb1b4d8b48c8b75841e7d0927c0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"ab3e53e346490fb1b4d8b48c8b75841e7d0927c0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-ab3e53e346490fb1b4d8b48c8b75841e7d0927c0","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-DPIJ5e3+LrZKTDYvwmMIGkUA9Z1hmE0XipOiPNELvIikgkmejNdFlXwHTYWaZOk3qzktbM2XgUJHaJsya07EjA==","shasum":"805cfa2fb39a86a1177eca1a52086a0f8e83519c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-ab3e53e346490fb1b4d8b48c8b75841e7d0927c0.tgz","fileCount":1178,"unpackedSize":8559620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbK7fnCRA9TVsSAnZWagAAzTgP/1yhYhfjdb1gPgNSlTZ8\nw1X4D7M6XgJhS1vdCIuInSaJpCbeQEUxA5Fzjncts8L1RRAqw+XGXhKH3TOI\nh83AX/qG0B+ST4CnJJGcw7UB2LnfifFrRXShG//aVVf9rHak2vfV46TXlffF\nwthtnVOVZv6jccLygEo+3dhekdhVRxQl34ZtymtlTZmlI+07HvyzZJGiRYb8\n6lPkTqSZXJBpfJrtKnXvhzJj+W41NS90QYQI8Wlabh0ZAu08ik1aTf12oJHV\n4ESvaW/uKJhCZaHBBgjcmJF9pHLRvSsfKziTsyARpP6oQBF3pQrnDLcpxk8z\nt+ycmUaNY12gu5ebbNiVaC0z3YYzBe+rQEJ0E4Brs3XggAM3ht6AgfFG0WUL\nXI2p2u8Eo+87epOA1hQzCPvUEFmhNveYHYL44qBhxXi+L53ZTYd2DqqSiZzT\nRSBK2VY+IRwNd+MIwyTaUIGlMqkxUsIltr/IOUQf7wxX7hGYK6xkwOSOuBxQ\n4fQFH2YyKWBJPnUZEONPqGEL3ei11sfUw3Bz0CXJZnBEtQa3RMrKKAzvRR4Z\n980KFwrR0MOW/HDHjRv2PKpWjTLqdUDXB7QfVqqmf6Okt/DCo7arvzWp7r+5\ngJ4jsr3lbhcmSqmDSAsa3xXdwBWdKOUdbCAdljk9N5rKxR1EiVYG88wXQRmV\nDXbR\r\n=mo8c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCShdDK+S8dtV6fMWn0GfD0PFZGLE1yNH/AsBfGzXPx5gIgc3NXPUuynt/5b6PS9p9MQi1sxQNrVkyoDlJ+ktsjytw="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-ab3e53e346490fb1b4d8b48c8b75841e7d0927c0_1529591783598_0.47012688946705916"},"_hasShrinkwrap":false},"2.4.0-82f31b36c9caa38dbbaea1ec7f01d0879d91587b":{"name":"alfresco-js-api","version":"2.4.0-82f31b36c9caa38dbbaea1ec7f01d0879d91587b","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"82f31b36c9caa38dbbaea1ec7f01d0879d91587b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-82f31b36c9caa38dbbaea1ec7f01d0879d91587b","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-vAhOKiUeDnSDGLVxgKiBcLruN08aLQscr846jWkMqd6iF8PJXurcDY3xkfPuNyir9xtTMtlDJEzl7Ec0/0XUdQ==","shasum":"50389dd22986f0fbd0c39d7a5d53c6ba2a3746d5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-82f31b36c9caa38dbbaea1ec7f01d0879d91587b.tgz","fileCount":1178,"unpackedSize":8559329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbK9o/CRA9TVsSAnZWagAArhcQAIUPIX+rf8ebdKHw2cUE\nLjvSr+sB8Jws3URL/Br2tMzJAr3AY0mNmcHSy8Bxr1AUf8ZL/+VLBhy9O4wj\nkLpZ/AOvvohkT3dmJXFB/2aUpRrEQTLqeh9rVonGRE+LdLhC1+rPzsjZ01G4\nlEcM4sBA90Zuhii2IPYyMqxsBfboXEsCLCmhyUue4Y9hnI73jhuToEEQom+N\nKk+pd0/ZlXzHGqQF9qHEi4hbazvPbsKsI2y3D6fo0+VC86JupDG6lMjVPccx\nF5g8dsrZ2NXWEPJyT7SSsByXwQbr3BbpGtP8BDU9RH3O1uDzZWpzaZCBKjTz\nlPwgP2/ZORFWTaywgsB2fvcOmIwFAX2N1h91yUAZg3kDvEDcfbh0Hbqx3ii3\nFhL8pvoHsTyuKa/u6l7k6x66lW+B2naXZWqn6YE9OYRwlOmp6mILFFmorXKU\njlq2dAnsPX70Tq0XRnhk4o496D7wYji4VcnLMcKcNQhB567aJbykVa9sOiH2\naf8t7uY8a/eBj6DEpy1Ix9UMVlhEkMUqcL4dxXZmuPCsTESmG3wV5bFZzTOf\nKD2pDGTvs8CHW+0Ruxj3tPpJY954OaRmZvIRNPCrHM3DgdLebey4Z7CqjlGx\nnv4aXIqIRjlYqrd8yT+2FwoLIX+i66Ms1uvNNcju/VcXMY3MQR6YCkkkYoFx\nw56P\r\n=Y5oH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuF7pGHCq7wNAMKf+RXWLFiOagC9naopKd0uOSlVAZVgIgS4lIY4rJD65xi563lLliRxaby4GrwBxWBWUgqElpn5U="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-82f31b36c9caa38dbbaea1ec7f01d0879d91587b_1529600575074_0.8996108932415721"},"_hasShrinkwrap":false},"2.4.0-8f01b36de0e8b74f5071e86e4753022cb3140ae4":{"name":"alfresco-js-api","version":"2.4.0-8f01b36de0e8b74f5071e86e4753022cb3140ae4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"8f01b36de0e8b74f5071e86e4753022cb3140ae4","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-8f01b36de0e8b74f5071e86e4753022cb3140ae4","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-JFYo80TspsYtaBBSZnyggcXUIJFC5Z0TSJ5qC1Cgs6Q4zFRostBbStW/gpxUmwMzq0tolqS+vRtet93iw8rE2g==","shasum":"10dfd6bfd6d49987ee010e1489728adbe93ea0c2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-8f01b36de0e8b74f5071e86e4753022cb3140ae4.tgz","fileCount":1178,"unpackedSize":8560413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLBB8CRA9TVsSAnZWagAAKLcQAKJ5MYXydGc9ZxYcdh1W\ndd9C0tRGw5oBX/XmGILdTgGVTg5VPCNBxxIYIPoZnTenUZPMV/M9TIjh8CcE\npkz26rUoZ2ZQUaQIjCTEM67Mmzf3KP65ZvGpJAkLk8Ne0eFaELihLTVUyotA\nYMxpxOKOTc/rqQa8lZjyUfJQ1Z3Dd6cxRKg47jHx8lewvX9WGuvBjFez3h8x\nngJhFAq8xN8Q+R+8tc1RImbQBzcSxULOPqoZMPt+Zc5ZRB38wOrVgWjRWQ68\nvg2Kc+CmVjPbgtb6+nc6e12LqQ6Fn76OFMYaOjNmQZMURs+2luZtWhPr4eP/\nlFbJza08ZjiyEazgnJ491gxScDebA239KFAyBu2bPn3n1M+YFHATSpXtRheo\nVFPFDjVvhOOXhsCPRWxX74TPbOkj9Gs3qLaKQ3sZlQHLcjmaJKW0waPVbSKO\nIpBZJeMSU8QR55eltoMWhe2vhHyKIAqtFoGOD2NeQda7xijPNcp/a3PplAes\nxmt4206jaVoSsZUzE8UjtilLDDaOpO6iFGYEToDIEfoIfxAPd1UYsu0iPLy1\n1AoRjlAIdLHEc2x7HCC32o7cf1KQWTWvsBLD+WWjNCzsc7C2hhrAWSTV2OY8\nkREiz6aR0uXOw6M0OvEsuB4k4dm2J2XigOtm6o+Nn1DByuANw2PLrvGfs/fz\n+yFq\r\n=sR3+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvrqPJn9xF21SZ142apqFm3VUz8xR6kxOHb4itF/nYbAIhAJ3/fdGZoUqNpXczD8z+KqBXJPU72w1IAQfrx5tpOBz1"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-8f01b36de0e8b74f5071e86e4753022cb3140ae4_1529614460433_0.6402587405831912"},"_hasShrinkwrap":false},"2.4.0-7b4280f696d678984c21f6abbbac1e9c1cb33c24":{"name":"alfresco-js-api","version":"2.4.0-7b4280f696d678984c21f6abbbac1e9c1cb33c24","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"7b4280f696d678984c21f6abbbac1e9c1cb33c24","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-7b4280f696d678984c21f6abbbac1e9c1cb33c24","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-VGyFRSyMYH9la9oEs66gJ0u9OKzzRXY6FzBWXRkTMCqbVSzUCdSIXiOE2h7I6S0h66OVBg73oIbpZRPIIRNPyA==","shasum":"6c007528954a864834bbe10a64aea9580b7acc79","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-7b4280f696d678984c21f6abbbac1e9c1cb33c24.tgz","fileCount":1178,"unpackedSize":8561079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLBO+CRA9TVsSAnZWagAA3+sP/2pKtIE+Ro5ca0E+Abm+\n0U/Tp601be43vvHFGbwUIwOERj8z8Uca6kn7x8Gxg5BMS2tsfA+J1/GIy7U0\nxKzuuNFO05LYYabG3LaemTvy0IohWv5L2omgAFAd7TamiEp5K8iaGKOflQ+4\nECUF/eLTSMtex09TjgILIMqikw2VlahGX2YMfY+UJqAhskHSCRq9Y0ouJDx8\n/CbQvWaCizDw1i0z4hgLu0toyKZCm1bxOE+VYFhMQo2sJxUFg7vEPPs/dbGd\n/syvoC+lK2kTWnCJzNeAwvpFE22gLor3Q95Zsqj2pg/SjOD6INcPlDs2dg4d\nF251FqwMma28kqJ9aHYmR4T1q4GovWT5ovwTTC08aQF/lIuwoyfOvAIsUlRQ\nBzZCF7Om3MRFeoYdTdJozhKTKS+2UDTp5dG0xNSgPM8KB3eRx/WD2tVSmDcJ\noRu2SGMxlqSqGQ8ZsgnBh5R7yM1X6isy2q1Gbt/gGI3Xhc/6GCcZwUumJqH/\nwAy7o5OK/hamNnmo4hs85A8R6PHY/nTgpqRPvfJEDTsfAEzHM7AIDXMmNi3D\nNFZQSMFqoDH1M8TMKlszmUq8Wdd0QwAjsAW6BJzy+RVeas7cHnKiHwDnTKfl\nFUPkU1kvgYvX+4WPsMqxPw0c2HFMRltmc0GGYqXW4u25MuZlG4mjeKO+W7lT\nR8fy\r\n=sQVu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBt7dfAB0qkmhHYHeNfHYuJtvUB0Zr9+m+ZKRgYKTxPvAiBdiLF6DNx5G07nLEzYUjxbiz3ThzU/MOL5Hse7Aw7E6A=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-7b4280f696d678984c21f6abbbac1e9c1cb33c24_1529615294124_0.1155670345416715"},"_hasShrinkwrap":false},"2.4.0-2cdf2936b16945e97b5efb9b6570b5641911298a":{"name":"alfresco-js-api","version":"2.4.0-2cdf2936b16945e97b5efb9b6570b5641911298a","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2cdf2936b16945e97b5efb9b6570b5641911298a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-2cdf2936b16945e97b5efb9b6570b5641911298a","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-GpRFkU/WPsyiMP3yJMEhNTmiS+QLGmvhUKR6VdoQEcSc53m26bcMhZqB4IgpKAcLXnm6OBnNM5fWqxNjv3+U6g==","shasum":"2d1812becddcf66a38843f0af6d6e847a8b725f8","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-2cdf2936b16945e97b5efb9b6570b5641911298a.tgz","fileCount":1178,"unpackedSize":8561039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLOogCRA9TVsSAnZWagAA0+UQAJGSWiD2xO2A+REFjP5M\n+jslwr9mXw2HZiOUKLZoneQQsWVwgU6cgVbQRvpg7RPMRd6t+EIWBAy/RaUL\nsCN+Qkyvej9M/wHIRQWil9EgBCHgOQdzcH/eN1n1/NKed3d3ze3FuJxobnw2\nFGzOEfi/7lg6XGHBKMNEYxUp95PAFbAOZECwhu3CP81vTR97+4jqIX/i5nUH\nLukWf0Rit1JO5LGX5UvdAomzTL5KVfg/Cv6Xg7YaIOSR4IJimZ057AoVFkjb\nSgcX00gHFZ78CABUTAq0tcAhdo3oSx6Hg+bjglOhtRutpjvezdEQBqRy0O5p\nX6K4Dyt3uxXFVPYQ/FwivT+Lw047JgrWIb4bvEHCVmYQaIXxNF9gHKPZI5Ze\nYS3VoFZ+ZnN5P3TJ0omO5BFf2+6BpCAhs/aADOhL2eYKDH3HV+3XQ3zremMb\nrRwfZRX3CVJkGPVfT+pc0WLgnHsbmflYEIm2jKWnDrBWkVDqLODHCKxiTZGg\nOtnpf/gtW0pGqkh6qRQ/e/3++7YW1+BfrFEeN+5STWXuh06/24DHG4Z+3ry/\nsxgQFkLeOZPDLyNxw7ExPEKocvcoqHr0h+HwjO3k9IWQKygmSOCwccEuXs2S\nvQXIsLVdqYtm5kKqZL1jDWeSTvYZuG9DYJYzFqlrAKeoh4Os7p7/Vnt2bvyF\ng73q\r\n=FZmU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZCAdaTQIX+HGMpq6kJWHN7g+nB2haezgxO7VMGpY61gIgYQYK59hTP2/7bAu94judWYqPBOHuQtePY+6R+Y/sxX0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-2cdf2936b16945e97b5efb9b6570b5641911298a_1529670176468_0.5288751420514022"},"_hasShrinkwrap":false},"2.4.0-beta15":{"name":"alfresco-js-api","version":"2.4.0-beta15","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install -save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2cdf2936b16945e97b5efb9b6570b5641911298a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-beta15","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-w8gJr2pOqtTopmexiJbknsMqs/bgWLM76U6MAL5qUAttMv1JtU33GlEhj8OISpZ3Oro89lGWM7gz3jejN6tfLw==","shasum":"379dcc4580802956d285252794b9306dc0194e30","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-beta15.tgz","fileCount":1177,"unpackedSize":8560935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLQGVCRA9TVsSAnZWagAALhMP/iQleFpz7ihzf9c2zlAQ\nD0xjAS413bDGsmFYhC8WbO7epoHSWu2otcwiHzTbYtpagi0KZ/v5ITz49pSp\n7h4kmAIzZXNHbWV+KFYEcXDCiZvgAn8eDSnpzvkEjScQV5oJ1C6rVPBQ5tma\nwyCltXPe1FYOUvmDTLL6N+EOczQsUY4X/zUGKIs0grEkfJpqj8jOi9PXFZKc\nHHXf+xRJb4/Kfb6APyA5/amKBpAx9MPJtspY/HB0xsc3iF3G16+TNUDqPn5O\nLHSbjhWaB8CfSBvlwe292nynGRrWz9ePQVkkxQnfwTMc+2suK0W6h7ECL0mk\nsx5cvyu4UUKc0L0x5AY1EbFevW3YNO8xv2+QhtSU2bZs8zwOx9esUO8OCSch\nf6oGLg4IEav2PPskA2auK11i/Hs4BY7lNfomi0ak0S8CzKuPsutdxQpGrQon\nXsU9i+AZfaXyQMyyXIcwvSYoqtSoyS/fK1+TaHpFqqqnl3JW6fFiDpdbf+u1\nGlYOck8JZ3bxY6y3WwK11ZopgUc3NZGIIt2egFivNWejDZyoZJ+8WFFf8weQ\nMbP2sHHXcWc0yEYie60j6FnuqT+Dq3P3cDTt58Mo2icumBoe+re/73PCtf3L\nis3WZwzMQhlc6FAUVpwne/UiUvxa7wzFDHXIlQhv2vbbHuBqKEXuzIyJYOsz\njw2y\r\n=cFK6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAI/197Hkm20tEmwhfe5fa1ihyfydHKDR7ONb5z7nDS7AiAL6Qmgt8YMXS0i5IiF539RU4H1RxEekqaJPnPplbUH6A=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-beta15_1529676181003_0.576436334708097"},"_hasShrinkwrap":false},"2.4.0-a86e9ab1b20ea876347b2fa7479d989a446929fc":{"name":"alfresco-js-api","version":"2.4.0-a86e9ab1b20ea876347b2fa7479d989a446929fc","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"a86e9ab1b20ea876347b2fa7479d989a446929fc","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-a86e9ab1b20ea876347b2fa7479d989a446929fc","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-8o38W/zHO0N1g+W12Fon20wqKwH5P+Blk2Z+12l3mAajKn0NAW2Wb5CWgPJ5CQwA8S1gTRq6491rpwtqBMkDKA==","shasum":"6171d59432a71609781d15820bc4f4c4f4592377","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-a86e9ab1b20ea876347b2fa7479d989a446929fc.tgz","fileCount":1178,"unpackedSize":8561471,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLTymCRA9TVsSAnZWagAAPbYP/RFNfKgy3/T581gU95tX\nvA+tlYIxuwq1GYDXHka08wmfkTdCu1h2YUkqjHdm3vBMmVRsIkVTDShBFUaN\nuDBjimnE1SockNKKoLdw02nl9L2e6N2RMR1KjcwTdwAWU2EI3MS/jM6EK7KI\n/m4JFL9aaPU8vyE+IKc9AYazZpSvqXH9h2wcjs8xoIFulf9iy5VG7BZ2V1u5\nPicP3/dfKkHBtWNbzq2KZmvV01RqZ5hdc/d5Fc8A1jUUllIsoDdGZpuIA2n+\n69BY4u0BX40G8TTTdM0tlre6hxZbz9TZYPpUc4QKXX52OR2drK+wWItMpFTA\no1IywfM5FYS7d3G1pO9Nw1Uu1wfeBoJfD86wkPRHgYqOKKWWusq1BGB11EbW\nu9gpBQwk9zkSoyMntX21cARAlfdxbq8b1uB56ZElOmXZ6dzQxePUt8I3IgXH\nAqMmz9r6TmtPhxikCFQtFLhBWwmdif8RYQZ3wcJmhbvscTt2P5MWi5pVqnmD\nzFlgShhJb204ZG4ONababuoGYR/Mnmrk0s8bF/FC7SJgAtLUVKzQTQ/tBkb2\nmG3AHz7p9OcgQBJkbDEzw2cVqVP1v12Uf14a7kuY8P1PD1zTpYs/JPAKSL0/\n+JhE7UYw6Ld6rXEcWd4hIXJG1qgIz7QFcrAHKkkMppWX5ZTx3fjdDZ/BwChz\nBSi3\r\n=ilCu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICIqZekUdPzMHj6WclxDpI+2xGSbDiTJY1cdBh0o47QlAiAjAJeP56n8BWoAYrsnOZUUf19l7pwUWI3dk5A/paI6IQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-a86e9ab1b20ea876347b2fa7479d989a446929fc_1529691302168_0.8914819379297629"},"_hasShrinkwrap":false},"2.4.0-92eae7db59edeb63e2e0dc1e4c2e6b182ff46f2b":{"name":"alfresco-js-api","version":"2.4.0-92eae7db59edeb63e2e0dc1e4c2e6b182ff46f2b","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"92eae7db59edeb63e2e0dc1e4c2e6b182ff46f2b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0-92eae7db59edeb63e2e0dc1e4c2e6b182ff46f2b","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-aRwa7PE1ZvMqW4FquRCJbCCtt7FNE9RVGjH2wjr80duX3PUkH/2GXEGtImLGQFRRgkX47ZfnB3D/3gDY9u4Vmw==","shasum":"ef34913874c61d6d70a3498678695da31c4e95e2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0-92eae7db59edeb63e2e0dc1e4c2e6b182ff46f2b.tgz","fileCount":1178,"unpackedSize":8561401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbLT4hCRA9TVsSAnZWagAADDEQAIyVO+7rufFIYduYESwd\nGF/4jiHrUNC2c2LYTJ3BPA5+BftXUUcB6OtjmrtNV+lECklR0Q0XUBMnaxIh\n/x3KnnAcgBg7acjIPFLQjRxmCCY+hMaj3O0rkcBSARVGrQgFPsMrZu2tCp+s\nRfYoVAVziuOXPYsG6DFnEqqKNWZqGbiIn08KpuK/Ef50qfNoqC36zcWkXoub\nnW10uD/LY5NvAWCXHYqXOQ5HQ9Uk69U4TnD5WKP3mLZ6yNxiHhl/mMXRPRdr\nQVAtj/XhlIeDgk91g6ylqrVQd24Kck3jef8U9arOpUarFR1tqO6jktlZBVYC\n1WuNdu03wy5eh897IIINICAqWXhqpjAUIWsKjFV3YOq3Jl/eoTjZqoU6c8mz\nIQcJVmuH+ZJMTajrZCqteauA2ofIMfNM4ChCjULoRYIsrHJkD8UL0Gbz92YS\nduKkqIQaKe94MDeqU4xJES+utET00EeUgdZ2f1X71lqu0NN//k2YNvs2t1t5\ntWVVEWST86b6C+xmGGg3J1Emxlz+G+Q/kcig0ri5YzLJN5L9dP9btxdbFzWK\njh2/wg8GqFF/bTn674fE8LZ4QTT6qYn904hUza6BAsBYo+gjao5ttRPbJ+L1\nmNKMZhwdLQ+qYfpz2uhrpB1a5eli+Xi53MixH4Cv8gw3iKnkFQuy3vPW5UqE\nZHdf\r\n=REl4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEZqY44CViG6B6x+uLmntEDSRz8J4Qe/zq5tlaYDUhvwIgDMr5DfuDhi6BjppnsXaJG3/F3FzBJ6aYdAceqXOYXPA="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0-92eae7db59edeb63e2e0dc1e4c2e6b182ff46f2b_1529691681264_0.8910123398451923"},"_hasShrinkwrap":false},"2.4.0":{"name":"alfresco-js-api","version":"2.4.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"a5c922e1a38a61d85dd85e519e4310769df7f66a","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.4.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-XVf/B3fE0Rl632SU3w0/m6EX/HEwOebIHjP0tluJoD174VONiTsoBzUuicliZvsfuHAeLC5YqthCV4PaKnehCg==","shasum":"523eff947f5b0160c6ce92ab154ca9fd9952386d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.4.0.tgz","fileCount":1177,"unpackedSize":8561290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMMPDCRA9TVsSAnZWagAANioP/RXM8UJ6XodWmCtbQZvk\nnkR2a6jClbg4Oyo9tqooKPq4Df/q36xVOXko08pE+IdP+1rSeTxN7GgpQdiU\n42ZDCwXW3sCcnzi0pQU1QfgtIbLELqw4DVW1Ra62xyvc6Nx20S4ikhsAo0xi\nYKCgvG+pFr3IFSin+pYDaFiCbXZ2516fZP47GNXspFaUUKOBcomWd31I+Voo\n4staR2NX7rE2kWGQG54EDzBatMbcY6hAFhnofet6iMmkVzxeJaOH4Jmsyqca\nk1W4t/3Z778zS4FrhZtdAij0V9bN9VbM1L7f0Jn6oUK5WtdIbXpq3I4R4nbR\nHW0cYev0auPj7hZDUnDeGWf1HAv9V7VAXptJWLTv0eTSELeyKrtR3eDvX8C1\nA8F32uBHF9VhszZE1nn6vHxJPxm9SJSxN1moHpbRT53wJ9gSw6wGU0bkK1Ao\n7vWlKq4AjnXdyUoBh7YPHp/fTr8n2s0TOru0jZ8dQnERB7uy1HUEvTH+ZiSV\n9z7hlSP8jl3Nh4dP5dpyBUbPqh5DzdQzJXS1dD23SWuyDsGJZQPZ5//uymEU\ni6mNx0KP3HCJR0JGucskcvXAP0TcWVjMMqYxCEYu5/ieVaydAm1RP+gWn0y4\nVH2eF4FYdxYqW43gkjFiuFXhPjKmdBoUYgf8BPF7nwOsrBSXQdHu6Z1L/Q6+\nFkeM\r\n=9wZa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGyc9f4DrLrgs302VtniPiPRFs2VdusOkAX/259i9eEoAiEAhSpp2sTA54EXdS+pHETul1Z4xN0tOeIZeBQzM1iHB9o="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.4.0_1529922498985_0.06384094280038055"},"_hasShrinkwrap":false},"2.5.0-3a53a7c2417f4e004631e5b5c76097cba312a714":{"name":"alfresco-js-api","version":"2.5.0-3a53a7c2417f4e004631e5b5c76097cba312a714","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3a53a7c2417f4e004631e5b5c76097cba312a714","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-3a53a7c2417f4e004631e5b5c76097cba312a714","_npmVersion":"5.6.0","_nodeVersion":"8.11.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-hibbA/ziZuJ28xUnwyLbddsdn+idDHSSedonD0rzhuEsM3NN4SvHuQMSsHfssEDDQztKfYsWtjo5SjCjy+9JPA==","shasum":"ca130bd6cf76f47334c66c7df77b8d44baf216c2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-3a53a7c2417f4e004631e5b5c76097cba312a714.tgz","fileCount":1178,"unpackedSize":8561735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNjdCCRA9TVsSAnZWagAAG2EQAJH393zE6efnV8bWzhEz\nyerK/tNrszXtC3Ts5J8ryVv225pFBmsHRzvkF+m5Q5cYxNhdqTYLJQ08Yz/O\noLyVB8a5HPIzghqfXqVwY/hTQq37xiVwrfRMknf9pjl2CXnh9ndaDccZIXRK\nAHCRXn7Lte7KUje8PT7xE7uhNty96N4a+R8QBRAHZYBhUHdWMQrNM4MmISyu\n12P4C0HdgmSJ7YEAmW6JpQYDN9fAEZ2hftb4cb2Q0ewoziCBWoD1XXTKnzUU\n8vxEinsItGOhVts3Sef+++HGoyIQLOhge4ZvvKwE8YCLpgDdlz8vBm8XsHaM\nqaVG1h1zP73uruqsQZaDUySB0z/RQ3YCBeo7GgULtwmxzgCsnCxV754J/DFy\nyIbT1efTWYs0g6C3rBJ1NpTCWwRZ85Azl3e2xfRAgGPKbr8+Y79H07FHpXOH\ndr9pSrtJAP7pEkybrz/JhRN9qEUFkWL2FMj+xlgpbbr66cPWMMq6ifm8Ihlh\nWI3SPAlDHh5XN+uDaQE5CJFOWuiKnW+flO9092aA5kQR03DiMdqMZKZ1yaCB\noyvKQzzHI/3alBNM+3e43JXNwxv90Leesyc/0AimTze8RDSh6a8S9tZKo0r9\nt5EogqWkIK9wNrhXwGaYMJNZ6Kcw6VjTEtQvFTMDts4R9GBMGq+hGFbPBRzu\n8flm\r\n=NDf+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZGsabSv65W4qQLK+B1k+/iSbSKF0gO7wYHb4hxLQlEwIhAIUbL18kUiLR1gZwG0XxsWXfIof61vKCMjU8kHiO1CsW"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-3a53a7c2417f4e004631e5b5c76097cba312a714_1530279745861_0.44001548995616235"},"_hasShrinkwrap":false},"2.5.0-beta1":{"name":"alfresco-js-api","version":"2.5.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3a53a7c2417f4e004631e5b5c76097cba312a714","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-beta1","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-xzvAE25CDNgEzXCARRBGnj+rLdHxswTUZsS++79thfOLl0gASQlOL0t6DdSDXlYB92+9mkgF1wI8LBLKY4DRHg==","shasum":"9197ba0534661732c9ca887b50197451a820d6a7","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-beta1.tgz","fileCount":1177,"unpackedSize":8561630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNjwdCRA9TVsSAnZWagAAqPsQAJtrot7033adQp74d1ce\nddIRl6goqLozs1gNLLvycmUUqg/KqIasOkXOjpuh5tfnD+exv27xixUFZyBx\nmfjkthUVngNbcPhXEs6YYdZgKWcqY6sMT0VOcz2z7J1K0ZMNClj4S+agAuIz\ni5BYBjmfuqnZPE9m7uXPjnKIEwg7X9WIgdCpOBJzN+ApIgRYN8SklIKzZiqk\nXP3tbksAKKMNCgqusMwj2W0B9rnxNFllR4h4qfR2pNR7SDA48fhbFLScm6Lz\n/BgQ0gtSZJCuvdS67t1rctz18QaaYoCE3fMRgohoMCBlz1BvIkw8QEZbb09i\nQTYAmiIFbzWc0megzyYagLwZXuMAgemuaztX/rpyT4PFwh2CokIOUmpM5Xsx\nz4Cy5zzUF4oUPcUC67BRnKV/cdCUztTwPHtQq3O7iWVi172GsuI8grEmiqFz\nbRLIxAK9T2pFf8ZzSu1LsbfcFn3rxO7v0WByiR8hxlqwwvDeVPqHWaRqdOgV\navh/hnbmM12jFtY4dL5JpFOA86YiQtxAPl0InMImF+/24oFVQKmOyhhPMSUP\nG7388/qqDICaM9Uz9aBLIUFrYnGNNbN6VnrdXHHGr9kaB4WUDt9STmiUfdu3\njOPs0cVX1i4pSrR0S7A/j2XWMLkeFEkmHXyNyAp7SKNhI2wG0TEUozOcDOmp\nzJMS\r\n=sIkT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIgPnuoZHR0jKm2vrXkpCPLTYFGl8PxqzQ9FuOk1PrcAiBs7Ib8bkGHp8ZUeRAF+LG1VwZRE/Onf9PzqQ3sEJkuWA=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-beta1_1530280989836_0.8507285332612038"},"_hasShrinkwrap":false},"2.5.0-beta2":{"name":"alfresco-js-api","version":"2.5.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3a53a7c2417f4e004631e5b5c76097cba312a714","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-beta2","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-VXT8mtlLd+WAoZDKRU7O+5Vpb7m0QFhZ1tQmyOkKgiTKfr9bf+W+wHccpsl178P5exupFrkBxAcnvS1UiN1GIw==","shasum":"09b8f5fb480ce57d35a968e52fd5e678f868c245","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-beta2.tgz","fileCount":1177,"unpackedSize":8561630,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbP3aLCRA9TVsSAnZWagAA9L0P/0TAPe1C8QXiHT55y0Qe\n0EmTdG+4i/yY6sd2VnviPmC8eWIsIrvwQtRK7JdHrEG8V7G5xSGti8ckE7GU\n9HVNRLz1MbGTmuDWy5+kxIBaO4FX4OMOD5tpfoFIJJokMnelReD3jHtHqZH9\n2SJJvtKfYPEx/Q0EJyZc6SZt0zeea4x00XbIAMtcg1fi771S9KfDyWwMCpbv\nkBkMm+Q625lfVs5S+J4eWMtNuAO2fwbMbDHnDUQ4UpAbZtfrNINoEmtTgjAD\nLax81ayValdm37UCCPiKkSiqJAO7CRLSB9rj2oDyd6h+I4Y5rsbDN6zXxNnG\nxgS4HCgeL9xqWkBVkSukP0fCmohT6cnMz362oYiaLz8lq03ERzf/tLhn/qLF\nls/ycXNmEq+g8GX4wpu5rUe4C64S+kajJ3GZj8sbphmTJliiUMCQU7G6Gv5B\nrfKAKzcocLTWXLpo2s1L5JMCMD3jCIKK1v9ac6/tY393NvIf+YzUtArpiB9m\n3kuiQeSn7w7NX81Che6k18sWaCdl7Bo9c+ojDIBovcy3oFKGPwvpQXFv6yyk\n3QjsP1ERw0XXi0GMM75WUYKiAK8j2N8NjHbWStUmxlKdU4pzOPdk02EyLrhE\nvP+LrTFjtzRqfbbKgNBnoAEaLqD6/LQorSgs0hZFFszCciLOajNqOnGftJU+\nkqFv\r\n=gYDB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnltTxaTkqx1Z3NY7sqkSfatPwT9vJ/YlI1uxM7JLSDAiEAuwoejO6Mt9IBCtBp9XxZCzFZUkXoWlVVPueGlBipOnU="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-beta2_1530885771158_0.8082693944389121"},"_hasShrinkwrap":false},"2.5.0-d5acbab9993711f37b66351a6aaedf6fc72d1ce2":{"name":"alfresco-js-api","version":"2.5.0-d5acbab9993711f37b66351a6aaedf6fc72d1ce2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"d5acbab9993711f37b66351a6aaedf6fc72d1ce2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-d5acbab9993711f37b66351a6aaedf6fc72d1ce2","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-tcwfDzOHvgWchmpurmiRT6XwyojxZ02pr/fM+w36sU5sWyAlgsf2PNiOEzPaYCOC64FOOyNOK9XZOeQZkgs6Uw==","shasum":"dab727e355f6c05b649a39f295138c6e47be5b81","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-d5acbab9993711f37b66351a6aaedf6fc72d1ce2.tgz","fileCount":1178,"unpackedSize":8576606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVgb6CRA9TVsSAnZWagAAqKYP/AsBWwGsnzB3UHZ3ssJl\n2Ez+RehDIFsbhAIftao7APqD1fnL8byZzgt0aUNuYhGpPJ3KeD/1+oePHXvk\nfnPn4D54x1imsWpoUww3UNletnUQgpbvXyVlq/u7lTTu0Ayl8C7Ek4kAf0IJ\nLCBtq7OxdiTE9lJxnYoDmrUy7t/7ZGitaujgursP/gVIVlUwfZrxmY0jdOm5\ncp94tWENJCj7zHXHNnHjEQjxmjTivxcnIdwIbJl2KeQYzAS6m3iMCrlrlSES\nsdMTTiUFO2uMbzvXMWTTOwTwgMZAOHycV4Q8IUAC+geMfyNhtQ+Z7V9TEm+3\nDTcFl1QO7RSEDANoNasHnnIpRUYtw0Eti2Zu5+5Fjmq3h0mXNowQyTtjoMc7\npSm87lUL+xFfO9k/bIW22dLyYT2PvWLdco1ZGqh/PgHayQ9O7Mv7iAQaCIHP\nukETfVcRxx3c6/P3oRlDjEgZl9CvHxB3097r7H/g+Aliu3YX2d+zXzHCxOKo\nYOCGXk331OuswG8k3SCaiB2vZ5lIFMrXNDRNHeEmqCAju2V6ZMV9gvnpnqEv\nNVmjPRyEoLEjCMNZ7wvNAQ/VFqYs9dJsSOcNRmNWa4iqaUWfOqGNttdoBnx5\nPlTr3nfnLouit0eF6pGUUnjlnXxoszeasCfF6l76ats1o9dKqa/4I4LGRaCU\n1suy\r\n=PyCw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR5Ph8QrUjpX8YJPa7TVWVvAZajlB49Yy5MpmOSrSt+QIhAIG3QQIFh0cH21iIPop6Q/vDqtqrx7lOJzNwDgzJpE0n"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-d5acbab9993711f37b66351a6aaedf6fc72d1ce2_1532364538029_0.2717020478105656"},"_hasShrinkwrap":false},"2.5.0-beta3":{"name":"alfresco-js-api","version":"2.5.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","jsrsasign":"^8.0.12","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"6.22.0","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"d5acbab9993711f37b66351a6aaedf6fc72d1ce2","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-beta3","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Cahb+ZSTHOhGJ4nnKNmKptg+ANFDUggVR40I3nz1/NYdyO11uqTQdt4dJk35sl0WS5VxYzeFAfj8EJgLijMI9A==","shasum":"0f44a95a17297682fcdfc62b374694f98970280f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-beta3.tgz","fileCount":1177,"unpackedSize":8576521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbZKSuCRA9TVsSAnZWagAA+wYP/2w44AXIa5tluEt8cHfs\na4Zhp9LZ+uOVCTBqfOO9zy6QVjKlXpaUk/aToXrzuf9q/HBJyiDS5jausu4S\nzfuX8j4hJK/uSxIxeFyLbQJ+YQHABpOua/IK1lOfLbxDGqRSykHZ2lzHXxur\n5WXIU2Nxpxu7lz/3DDc7xgB/lAd7Md3OtLyRlKGnLuz1AKmDmbIozqN6trYX\nJLcXca6AaAT57uz7lu7B4xMK3omYO+X+y60YyRQeB3ExxI3S+xPkNfKJUgWD\n7DEQ6uIJhjqbwNkoH4+2a1AcQ64QOItjPyKK4sT11vLbBe8LaCFYcexi6vQz\nv34Dq11GkKmrFKBesbrDif1jEGjQn7VYi/RtsaFASsPT/0eKUsdkWPtM3niV\n+2l9kLq8sfEryJ/F9HnfDJC3SuaZswzyNFuQCGxRcg8/Pv2cAK+110HFhDtz\noHCHAeOoygRqEGpP79pfq4eebu0mPkGvL4Rgxl1tkYNefv4L51Kg+qt2mM1W\npicO1rk6dCogGEtnOedpzQ/NWzcUcn1qhF7hLuO7BKTMmPL+WAEDs8wadPIR\nl7DFOviIJcPE858Hu30xjtmjDyVeRecw40s1pcNj7MGKws2ubRyRFkFdyeah\n8IoYETTombdZjIVDGV6VeRpxOnAYDgeNphm4BihEhGP1o+9waBtVxDNu6VsI\nwwmk\r\n=32zm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASvD7xnjBUcZcYUCcxsNqFXtQzhrbtS35UfT/1UrqbtAiEAu37I9iM/4Nb/Cc0XvSiFc/xHUaOqPSeznSd6FGwIW10="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-beta3_1533322413639_0.48007281366141963"},"_hasShrinkwrap":false},"2.5.0-bafd6cb5b1597a4cd92ff396da63f37cfaad93d3":{"name":"alfresco-js-api","version":"2.5.0-bafd6cb5b1597a4cd92ff396da63f37cfaad93d3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"bafd6cb5b1597a4cd92ff396da63f37cfaad93d3","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-bafd6cb5b1597a4cd92ff396da63f37cfaad93d3","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-e9FUTTO1Lt2Ap6JjSu009sNu0+k7tNCC6d97lolXaarOE98l2mO3CQOfnQIDUU+3psWlR47loKm/FLAVsFpZjA==","shasum":"fad4fe2fcdc75c01ec5eefe4c289948373842af3","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-bafd6cb5b1597a4cd92ff396da63f37cfaad93d3.tgz","fileCount":1178,"unpackedSize":7048206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaH7MCRA9TVsSAnZWagAAykAP/jlheP1pQleUH1FWicVR\nNrwr1D+YVQDQku/kZYnmbGaLTtvBUpMgsFlAcxVmQLe8h399Xd4dj50RNaBc\ndmY9NOKRA1aG/zFClyGLDrtFg47+ptD91XPdasLAwErGOwmGpCqEov3GM4Z3\nl6RU9Ol/68eKq7zgx4Qw6RCrpboTlhsWrvwmhfpcSPMUBa0lxoPSM+EPOdg/\n5iYlCXzZLhZQKkmKgB42Ex5h0idXi0tIWmFLtvsQziNVa6pejmRydrwKJ4OP\nhB9ugwF+Xu63B6TiVbl0uvSxd8D5WUO6+jc+CMth1U+v41HZFmERrhKcZN+N\n6vxuks291QyoGjMnsMOr+GhwBu+WkG/UNzqab/lo0jTaZas+8e2amgPObbVK\nbegprb1UrIAzFcKAA+NeidAQ8A35c6qf3+qmV6enYIs1AsW4kUcSk/1UEB5y\n2e3/Zqy4LG9R8ZvfneCXD1U/UG89mtd0QFus6liWfHja9OYI1jwEfjQB4xRj\nTU/wdhWG90oFKfFJPEhEL8hYRaohIqAFuRSg1ni7XyLFwcDLu5d9mHkHQdvX\nn9rRpIK3PonwdkRlmhSbgRdxoHmZtLlJMNNjAeAD6oATuE8tLf0KqlslVBEk\nSVGTm4S+Wh43rddZngL0RedDh++LAkyqtlbJkG77xzXX+PiS3PkWVNTJFVSN\nyd42\r\n=DMhB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA9YroX9eb9T8tPWFTJTx2GpIqugQY7jIoz1KJ3ZInLFAiBJkYkM0ud85lMTPzUFkfyashv3zm1viGbA/bWa0S7H7Q=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-bafd6cb5b1597a4cd92ff396da63f37cfaad93d3_1533574859654_0.1962349308738074"},"_hasShrinkwrap":false},"2.5.0-beta4":{"name":"alfresco-js-api","version":"2.5.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"bafd6cb5b1597a4cd92ff396da63f37cfaad93d3","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-beta4","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-7s50SXBAqvPoJrWx8iiCQ232q9ZOACdW8vboexTRjjdnlHeH6nviL9KiG8U0FqCf/YxyadwOVQd27ZSGyxTatA==","shasum":"482ed59c3ea9ac85c096bc40b9d25f29b1af3d08","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-beta4.tgz","fileCount":1177,"unpackedSize":7048101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbaZJSCRA9TVsSAnZWagAA45EP/RE96ANScBWtBbg1bu+w\naxsNjo+/ltbyedguOuNOnbRyikUzVKds0p0RbbkVuK38d9LGlW9DvtS8jjXv\nn+7XJ+pmuuZ2D9X4p2Vq9gVA/8fv+UrDNkyZBQz1+DN1aFTzUIDErgQLvPl+\nMnMcUx3eaGXq7MPlN/Tiu2hY78oBRcKAum4WJWrpncXCAA9HDg+Q/z6/q2Ay\nDP9S5UTLNmKclM/HYVzYQaOvgsIGuoh+S657yqMRr7W0DPpYkw+giino0tIQ\ndWiT/DUKyhnT7eY1ueOu3mmJvw/VVfnXbdJA2+M3j7bTnfsa0mbuWUKLdMf0\nbEsRAaGnPCbIKQbR8S6k9HY683wl5c/yebpFh9VI0dVXliCMkAOo24kjKg+r\nHu2ubc2mf+GcayVFWZ738RN/qQz1bfHf6Gcyoyl1AbGwCOSxsoU3IBVcOETF\nZh4Ank6XFNlwlV9bTuAgyUci+Coiz+Sj6Syvm80HnYJv4FbIqm6WIBHfzk3+\nMac0Hz+ag23hGki5ICnZp/2/vUOlxqtaAvW8g8p1fqIqFERWtmdXOnlAj0+9\noeNa6UUtrucH+gUiVg+BacRw+eg4raJsbiTgOk+6WZ9QfAzO1xSK60TPTp7y\nCFsv1/3rNmB8hezKtQHARmDFUphP7I60mAktH/d/z2JLTJSmJaj/J+m97I3h\n2HDx\r\n=/u8A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUWMM28U7TR2Yc5D+O5D1pAprQiJQQhlirSnOFIcffHgIgA0sdhmcBAXSZohczoPo3Mv+keZtMZHVJ+fNvsNDm4ls="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-beta4_1533645393848_0.1720973119073601"},"_hasShrinkwrap":false},"2.5.0-b048ff2aad00611aac1c02af531549b60acc0e66":{"name":"alfresco-js-api","version":"2.5.0-b048ff2aad00611aac1c02af531549b60acc0e66","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"b048ff2aad00611aac1c02af531549b60acc0e66","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-b048ff2aad00611aac1c02af531549b60acc0e66","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-gOShpMSFi+kS14gxp8r8NsmHSWwGZ9MOhZsOha0bnVvj/czO/B+z99Ht1TX9xJpj4jMLfIz9Z/VcGsdfCJL9oQ==","shasum":"051441a9a6336541a8e2be6c231440c578c8b658","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-b048ff2aad00611aac1c02af531549b60acc0e66.tgz","fileCount":1179,"unpackedSize":7054917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbau6RCRA9TVsSAnZWagAA4/QP/3pivQo4fBJ3YPQsNSfo\nSmH5jq8QUZDDTUofa48Gl7wdXFzWC4+fJfTURjplDrKlR3KUQgqXdKhYb6ap\nKndoALB0NhwD8zG1Rvho3+DB5O0BataNWq/yA/6pZH0No/A47R4Va9yH5Bhw\nYDBPP7CVGjGhDZivbIdSfBzwfjnPzOMLtBvPCrvC2r2yR+a2AwbOfMUTRMmE\n9ZV6SQb4xJCdRLWUMSJCoEMLQ2K7TxibNzndJU4chsnVLqOXgtDwRmpaI/uJ\nYztXirJ0yxn18at3F8fWQajcxO3dkIhVk18CE72G83iirrQSXyUhfb0qEfQ4\ngkVMxkNgIGadZnq3VUhYNOZ/cqnReAd6aKdKZocVNydLL9muoBol1ybTX6WA\n+l725aSq6bXnyKYLEh8gG6Hjucl1S/yHPjTmsU+Q2mPXH/FbKqveWXGG/glP\nnzFqr/Vr8Oh6UWZHcbCumJ22pYloavNazpuxe9Xk/p6EZLO7/YP5sWSWGIRg\n5OmiOvMKlv5yhcMYEpbNkuCN6Wd4t5e/asjLp30XZ13HfgcPysrwHFevwB3g\nP4Q9PBj4kmzrHT/L+Ug4Pj2insHQXfo14nI8pg5pKOgq/AJ7iTG44PEnQsNh\nKAhdBNJgjUelFqb+EWvBLtce9A0MFOTWAwNzvjJg1MzLnq5WgRPUCdwIW3ee\nLkuY\r\n=oOGl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICGauJyJ1AVC6MH/8JwZ9QbqLidqtojj0wpJrNTAzpbVAiEAsdKA8aWDpgzG+gScyz+y5LvtH6jX5N19etlfGHda1J0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-b048ff2aad00611aac1c02af531549b60acc0e66_1533734545677_0.4343000321624255"},"_hasShrinkwrap":false},"2.5.0-beta5":{"name":"alfresco-js-api","version":"2.5.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"b048ff2aad00611aac1c02af531549b60acc0e66","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-beta5","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-nRnUxvgwGIqzBip5JvZqbN2aKMq6q3wBzoD3bWp8++O/jlYw3nqQC0FzJNDFqxPzmRmhNm/ha2hzI2hABtrv9w==","shasum":"5b2b3cf01d07d0c7171834d104790e6867a59d47","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-beta5.tgz","fileCount":1178,"unpackedSize":7054812,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbZslCRA9TVsSAnZWagAA5UMP/3ojpu4dGypiQeJBWgfI\nfo67p/U1e/kFR7TvXVgZYyjactAOH5swKlTJvGeo2o3ulJZbgkQzwFjCRZeO\n2in/ynOgqp8oRZf8mPfJa/Oly9ii00jh8zaSg2zJ05rxyEXD6/eHthbyV60c\nNp2YnMFIhaHDGVi9+ZWknteGDuW0mhAwqeBXa/A7QVQS+AOmspxWVlZx8b+B\nH31dqiTT3OQNF0RPBkB8M4W1F39eX0XhOfJmklmECS7miUNF3DxShQU3L8L4\nkKY23ckcOiSdX5UeOA3qRvCEggKoFfCv2w1UvL8eGyP0sgFUaLpy7XqYVBXE\nbjNsa+Brl0Zmn+U/Wiar5ormdong69tT0VxkJqzkRMrgi+zBm29DEHjIzT7W\nrKtBG7UEA7LSiqTLmJxPVbyLzbN5O4pQ2dfoNiC201ZWWgulepyhsNDJDSFW\n07HFi2RFX2Wr9Xr1eaKgyMjt+BDfK6dOOcDleivPSVReW/ux7pb5SeoTuIht\nCzWHcT7+Asbor9UhmDxG01BfIsTwiib3SO5ZZVkkFQPFfQMi3tVndX5qkX1o\n6kAc8qTWF7Sl0cjk/t0tsrAeYlfeCp30KaQIdonuyoGE9q9ioX18SZFbLHb3\nrUFLTuG3Y/nkXncLH9+uzjXRbgLO+ddsz68QeHyaX4/hcnDM4FtveTtuj4GA\nsSH0\r\n=FsZA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkHWEcQtu4Qb1Ahsg1+mHUw5q0HeKxUXzT9+E2s4UXoAiAFxnr/Ixgi9x9u4Iaj6DwI+LiWijHmRJl2Yd1Lhn7/+Q=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-beta5_1533909797306_0.6555255361449712"},"_hasShrinkwrap":false},"2.5.0-f524d72a16879f26c210a5e75200a4b9fc9f3bff":{"name":"alfresco-js-api","version":"2.5.0-f524d72a16879f26c210a5e75200a4b9fc9f3bff","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"f524d72a16879f26c210a5e75200a4b9fc9f3bff","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-f524d72a16879f26c210a5e75200a4b9fc9f3bff","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6dLOQ9ZAnyf5Eqkw6oTJtzky35sN98R4mgbYBIF1mYyrW3xDH6gQfKMtolEPH93qxOeQuFAVo+0MlSUTuyrJnA==","shasum":"8b7b30c4474f9b8bdc132c161d58deac6c9035ce","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-f524d72a16879f26c210a5e75200a4b9fc9f3bff.tgz","fileCount":1179,"unpackedSize":7055033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbba3tCRA9TVsSAnZWagAA70QQAITwcYJ11PcTBMwLDS4d\nrc9H54/IJDS6OJhTB5o/15ryUP/yXjjjEhB1Cu0pCG0MDviY7dVLkSnFnEp7\nIeXKy/dY4bSbnYd4mTVIqTUJyKReV31xQr93d4G5CQWBbndwREDsQFQr42Ye\ncDBjxIPGV45EjCoz/SLZoPowNXmfqLYh9TjNcbfJQouhlI79rjeIBADOmpcS\ng3RIkYudQ2ZFCFGZEfQN7zFUatThnUIPNwGVU7jrkALUpiuahWSylWQBYIL4\nckxrER5r9o7Lt5coXbG5wZbd29nRpJ+9f0iJxP1dkoWiEUqw8u/X6HzhFIw7\nVvPwlGLCyt5zFGC91hekbOkF/ariXxhFf3U4pkmYqsYyWkJrDxfyNWI7vbgy\n91ZsUfKBm48Lj8seMmEbnfiBsznFff4hFgtUJEAKpL6o9SrxjdCF6vlEHAqy\n7FAixE8SoouWC6ImpSPqWqZ6rUTOEWpn8yO9JT1ME+QBuWmnLh9KspUn0B6q\n4k+IAT5asGKe8iwAV5kDIy0Cg8if+HVoG6GEB+V+GMa/vLM55TvlAu47vaZ8\n21+IwzjxwQxYtU4WKTsQUbKnkGSx8P5L+sCM+LOmeRDS7zHwyHGTEmq/pWmb\nJtujNvhTa89/5h4fdN4viHcy26UOowdNIP1TpfGg8OjlIDUnu4UTsOopl8hv\nYxat\r\n=D9dZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICLGYuCimZqvxiQ+dbkaG6lxENoVKOzsNVBw+5lC4AZ1AiAHWub+3zQ9yNrm8lC6hCPy4jDto/IngGo0B0wSYDqTRg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-f524d72a16879f26c210a5e75200a4b9fc9f3bff_1533914604259_0.19687314852595916"},"_hasShrinkwrap":false},"2.5.0-2f54e41504a87f5d60c6863ab1ba05744a76b2de":{"name":"alfresco-js-api","version":"2.5.0-2f54e41504a87f5d60c6863ab1ba05744a76b2de","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2f54e41504a87f5d60c6863ab1ba05744a76b2de","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-2f54e41504a87f5d60c6863ab1ba05744a76b2de","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Tm8FSZdZUxr5bzm4nPj3Jb9rbnPlz0l9l9lClURDaoE+eBD3OoLvXhX5umDEo/LX7TtCsfyRd2e4DhUwSfFqmw==","shasum":"33a7d8bc14409203ff0216cd6a0f6c408270f4e2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-2f54e41504a87f5d60c6863ab1ba05744a76b2de.tgz","fileCount":1179,"unpackedSize":7055033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbey6CRA9TVsSAnZWagAA/JMP/32Nr1vAc/6BdpfvGm4/\ngV7zHtRJtzCfbvP3d5VOX7nUs8GJifwHgLG3v2W3VCZQtEzn+JwzgEw0FXN1\niaJNYMouWCjsqWsKqISHVNNayEJ+NCF68vIP1s0Yia3Vj8bsLAcmzNZT5SR/\nPRm/ICv7ASj94FLJrpyWTBKlcr9XLRVkRRN6K3pjY+Qt/MJnSjQRt0C/Sw0F\nVMa+rwLn+/mTUFEoNFhnJwwB6E/7gDugm/PaD6/aCpp5krAbXghkb25QD3dP\nFM3Dm7CzzNV3agwpeuVuzvUo+Spcss3IEd0jQLO3hyfVVEPAJeFgj0H7hYKx\n84lnTChHUGbGvgIuX9g7agNBk+VA6oZFxn9PZnyuz13L97TM+567a31XCWMB\n2to4b9FW3uJR/GUZBsjWcTCiM0Y4ABCsyWJHILpjnD+OsKc4l6tp9I0RzITw\neuK8gG9oCllAUeJJx1oue0tfwmKre4GZlfkZ42Da2/WcCUIeBneZmTUIavXt\nQy6vCZqIbPGgWZ5bB+KlVcmLMmfIOWbIcZZprcwVTMq9NxJF3qh8YqZW5dHJ\n8sCF+0JPVaCLJ6YZhrHleQ4KLGwMm5lrBM7lzZCm4/EU/iCJ3Oq2WeI2+f5N\nk8C6Dl4Po29XYdvfMIf0GKM2NeCzAFkQevJMhr8BdEQeHe1eL6gon4rFJZse\nyaHp\r\n=jQ3M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/AdNr6XXRjNSoeItQ2ETRRhx7CttA5LS58o7HDWPBLAIgZgfvmX5By5gzCoGUfDkDowb3bBKkbmofATT8JeJyhFM="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-2f54e41504a87f5d60c6863ab1ba05744a76b2de_1533930681935_0.342127407371946"},"_hasShrinkwrap":false},"2.5.0-f51389cb83831f10b3a07506cfcd4540af92316c":{"name":"alfresco-js-api","version":"2.5.0-f51389cb83831f10b3a07506cfcd4540af92316c","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"f51389cb83831f10b3a07506cfcd4540af92316c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0-f51389cb83831f10b3a07506cfcd4540af92316c","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-HRwcWuXpDPp5xcVic05SR5GEpEzDOcuqaRZWzafnkGK6QRi875i13xQHCrvJmKB5Uw7Kzpn6ss/QIf3Ng/8z1w==","shasum":"e71aa9eb81022b7243fbca12f5f5240e4bacd1ae","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0-f51389cb83831f10b3a07506cfcd4540af92316c.tgz","fileCount":1179,"unpackedSize":7055033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcuoqCRA9TVsSAnZWagAA1/0QAJ/mv9tqlsJxivYfRFU0\nBA/KPYR+CV5ZnhgTu+fSkpTOsoU2414yWr01rpD/raNlAQOIWQ3pbbo/XrhS\nxrTQfUEB6XkHR7sv+BZ0zlGSPcROF1AxmHj67BFvNiuCex/C1ic4XPEe9AKI\nPu4ZX8Gx9RBhsWL3DknsQUh3s19Ig+pgKDMRBtfK+0WUKCaTNsueOdtZ+C+U\nQ72uGbpx2hvArDRCKzAeekal9I6Biw0yYQvnbWsAkx0gvOeeorxf6hy7hedf\nyxHOXSFFWX7lo/onzzXzp/1tegvKdUv+Ht/YdVwK7p8feJpQ0kKOBlr49Zav\noyA+Rk2xptGdDUN5qo+Bjea1MLn8AB4qquIa40p4Gxp6UEsFgRGYBE0tYVhg\nOmu7m7SpZ3DDZbXFjfY74z4nl+yxJG/ccYyR59vSPlbXHYkJrf8uGPsD4AuD\nYsgguDiep4qSlC60TKCQpZO46EkNOmAtjQXMfZ9bBqE4kVXAouFqQSxRqvZd\nhv8RhJGQANOdlMgXv7J74CI33aWrwiFyg6HXendkHNFwVqnH+L8/zEirQAIN\nvWMNf3dZaw+WSw436VW8BdENYFv0J5Zxm7iKTH0hGsIqZsr8ZIXBGqQ6Po/o\n7Is3f4ee3oihHGD3gTWarhXKquUxUvCuh/iiwFV0HF7hZ4yZtpY9rweIGWFn\nxaO1\r\n=3wWc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmFIQ01ai1sAjCZ9ZcZ7tjnfqNcrzRtV6OimrUj41FLQIgD2RCp9h5FePTa5xk97xM/dvNGu0Em3BzHBy19EVFaUc="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0-f51389cb83831f10b3a07506cfcd4540af92316c_1534257705687_0.13364781732601472"},"_hasShrinkwrap":false},"2.5.0":{"name":"alfresco-js-api","version":"2.5.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"f33d06614fe46ef9d5eb540b1f5b82619ea95771","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.5.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-0DwSpofMsyLHs3kyPwl+2JvIOUmTpPeJkBF5cIXO/T6+hst9ZYKQRQLxcoCnuk6Ng43MN14NHawtKJH6jE2wyg==","shasum":"fea94c7affec6aa8c2ad1b2b19c09d2396aae528","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.5.0.tgz","fileCount":1178,"unpackedSize":7054922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcvttCRA9TVsSAnZWagAAQsYQAIBtfvIOGUIWXxTurV/Y\nNvvA3BNHG02SSsjjJ15Fv8H8z4MEUk6O64ckImebZLg3S0Vp9jdftttFRSbv\nU6LlrDsS1btY8tUBlLitk2Y1Bl0kX3R/5YuFWihDmBUOzNir/jurmSZrlv2A\nk/TxJD3ZuuWUkuiP1rMvh/SUBddLPPnr55i2Xaq2uVLb7aL5bZHmmB5J7Bqe\nTi1eUVwPezwUwtW4HG8FaB73azMMTMi37eDB6rJAG7bLwL300TdESJ1+ch+Q\nfEuQQULXJk51VpvEeUEdRbwN2joedHVr3C80wc8OPYk3gxeQmdgfgL5Br5NQ\nlbC7pSTWjowC9KUwKbgVdQGRmbgjh1iGrLJNTIFLiCz3cGMbJfzYGBYPS2qw\n2O2UDOBDAQAVIeqebinEW/+oj5Ac6Fha1l8RBuaBDXn01iBp3FBBP4mIUlOE\n9OJAMclLWpcNdJFNdQieHCARYbsT4snY1/IPvd1LSaHuaNbPukBXLzMzU7Lv\nmf+YQla4mUUZgqISm4NVAD4L5a+MsIZkQ9J3RkUt+1J//4AEr+tjqVhSi1Wl\nOgWlndwuhXTdRgX/4kS/sCF4Gqa55zOs6m2v5WZC6xjLxRApfBAbxUzpNuU8\nDJAKel+ZkELU6Yccni9Sm64U/4IGPaxSGdJeKVImA4ZFj5L3xyqQBVpUwUB2\ndZ4/\r\n=pVUE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY+YcpQLhlXtUe4les6aix4/FdRRIvCSxtFY4N2/+UGAIgIttsKBHVYkl6e6iCUR6GZcnA2dLKyeDzIBHmqO3fkVA="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.5.0_1534262124274_0.6354336765135027"},"_hasShrinkwrap":false},"2.6.0-beta1":{"name":"alfresco-js-api","version":"2.6.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"f51389cb83831f10b3a07506cfcd4540af92316c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-beta1","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bA6as1gIvBuBX9pvoE+jpVnEHSNWU6t6pKl7NsuTbNC52xPflqLRnjKgSKqQip5nJqBYRiTm0YqcfOC0qy067A==","shasum":"b71db4bfe946632dc486c6b814b62a33d622e0c9","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-beta1.tgz","fileCount":1178,"unpackedSize":7054928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdtXECRA9TVsSAnZWagAARNIQAIKYnx8MiJfRmviRYJz8\nJ4OiNHy7zOzp2Bv6oYZEmqI12htmm2zMhxM3CURoPHi3BxNRhINdMld1ThR/\nUnMntNKOsB6FNNRK+E2VwTtWNFMwoEHfoHhb0GikNzic4ZZY7KKtjHTpkmG4\n7QcUkFu1wUAkddg8t/7Fko/8bJbGRykCjcdsC6ukZJMw3PDPxMo3mt7Qvs0A\nexsRQ0uIfo0lmd7DZ5Tc8CLCcOQM6/d/p/AMQBSvPlnxbtNrdVdZkecdxeZW\n4EZKc2pDn1MSzR+a/EfsV5Z2PeU+BsqXmd7yHZKAyJgB0kvbqQyET4b5op/k\nusUm6hTlCcX+66iIGDM+oPIP0NJS5MuQwJ17Hp5rJIWPPak8MUZcrOOx/aHr\nTbptxe3REY6VGxUcACQA1o8z21ElDm8hVHziI6g2qxP8zlnk9+t+NTxotSM2\n7Nx1NW4awRpmgguNQMPemvHM0QdNcMW/FHcEdrezUJri2hmQO0MJhDyNX1SR\nuPdA6U/OL+jeWtWZch6bPB7K1dBftYiRCmuv0Cjls6DuT/z5/QNHw1AmkPDA\nwp5ulbI9rFzt+sXNyk4agS8S93RESTN0XYqps6wGCXZwO2pwbXcQ2YdBXbXC\nzJjJAJGq2SxTNAJEojVX34nNRqsD1ItahCr+JE8QNbuSUVaq77UDuZJHmhIY\nsK8S\r\n=Thig\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBj/REJMLMg3D7iiSdLU2A1oRDyISIYIpmgdm1PEFvWDAiBGpbTz6SRpz4OcsIoAJywfs5qosc1XqEWryzOMAz5Nmg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-beta1_1534514627666_0.9399657811450877"},"_hasShrinkwrap":false},"2.6.0-beta2":{"name":"alfresco-js-api","version":"2.6.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"f51389cb83831f10b3a07506cfcd4540af92316c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-beta2","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-M6exoUaRmx0lh+QSmDXlnCF9IAhiUSuS6tHx9Q7JRsNTsDvUrnyEQ1Jc68ikY6uJ3srEPuyVvwRU8zNrdBYbrA==","shasum":"7f13972154c45beb9027e37d2799ce7efbc31c8c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-beta2.tgz","fileCount":1178,"unpackedSize":7054928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbgBAGCRA9TVsSAnZWagAAstAQAJjiyuxUcd4x4cxufdfn\nIfiN9OZvKk9Rt7F5itnRSGubZG6WjRrGHrmNjd07fTV+isy7GMK+VisrdhFm\nw0L8lqR8EHdZ/1Vz4+mcTwurM+oylPfnw3roexM63picnasrm8M5EI4g0YOI\nU9YAwiFlVkCaICM8ClZ+rC6Me/FS0ITr9l9tejPH0M+T3hEtn7fl8eAjQdQ4\nJzBGfMOdKXsndKd1cPhtgQ+c6sZ4znTdafGFVNQt84LKRUv8y+GNpVHVOajn\ngXVlU4zKIPg+08zor/v8wofowxQoEp8tVFFlJElmYHL7PudL7HzWB2Z0IDxR\n52a14GBCszlAt7cf5hBfKWgUXKObEaPuEpumzkQq+9WE42K2DPe1H8JIKM6G\nUYL8sSa9drt8xYBFLF/KL2CA9tNF/dCI2bkw/Sw66xlf14Z904mTA+c6YQ1Q\nyOB8RNLWl9b7GU2DDiX80HBTl2Ypx1BvCUDARKqUJqM3x7VQuaOaP1Bjdn+E\nJDKH2mGQlVINIakmBeJMFAQ8DaO2v3Wj0u8+EC0yjoQ/HK4+UT9hfy4Ngbts\nvMVwutR808DzE2Ei42hnNE8eocTdWaMU6HmDEdRhWUBj05lBVLVAOccmadm6\nmadnTNscgvImkKKqeQDzlYPs13uSaYxA8htz6VWCK1W7KxEZO+9JV/X/Upgu\ngw9e\r\n=PfXQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHHBJy5Xfc2bZomEWvBcUy03E1Cs4buFT95pHRcYNoxgIgNIt3yAyXY7NGjvD2hvzbCbfo1w2H3kxFJHKcXINKLHM="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-beta2_1535119365432_0.1852637493758087"},"_hasShrinkwrap":false},"2.6.0-2f8dae2e0477510ee4257b314d720eb176f19e56":{"name":"alfresco-js-api","version":"2.6.0-2f8dae2e0477510ee4257b314d720eb176f19e56","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2f8dae2e0477510ee4257b314d720eb176f19e56","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-2f8dae2e0477510ee4257b314d720eb176f19e56","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-vtZCTTbUlIHUFrfle8FZM2pDpHhKUDtTQDQvUO3Vimp5fzz18Yybac/CHhyNZbQ0SvYxYLMNhPweJ2M/Cw74sA==","shasum":"2a5b8f6a2adcb1e234b3ea880d64d58d05982ee1","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-2f8dae2e0477510ee4257b314d720eb176f19e56.tgz","fileCount":1179,"unpackedSize":7055039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhtLPCRA9TVsSAnZWagAA0GAP/32bzwehkvIb6dnCzIW4\ndbJP8wLUKn2KGDt/onRwQUxn/d9l7h2QaHGFDimUBfXtGKYKr/ptNpcJ/Ke/\nw5s9e0PPYk79zuvlawEfTWWUF9SQQhthQlsIdastUTRnRJrSjBpdUk6UT0S5\neEJKDG/y7XFscvcI9u4yhL3vkxN1AqJWunVAK1aN9g8so6ApN/ffnI63gTuM\n9GgdmDWg0+4LAnqW57cy2ov73mxffzlhVHf/AOJePuKfuq6aKzcfRdqiP6J9\nL62nN+H29YFkgrT7amqRT44Vhr1Iw6mypZv6RgRyspJx1AijqF3y1F+n7B1s\nvXz4iprGkP/eYuNu5tHmz/hilwQbspUGk/Efe7F/ZliGApoD8ISfCsGLJ9mQ\nF6zaG0+VWD0v36XJhQ5yGaXLt5LmJS8859dxS2sQZmEln0dWdAhaVg9bW0kH\nBBSDpA1MUw2Jvx47752CYc9PnXBHQTfVuU8h2GTl1vcnesHBoCSqih5YpO58\n1SDldEZe9mcKLx3ZmmnWa5MQ0QU7rZsqULOyD03EDY5ECKo6tcHw26Q1kpir\n2Bi7MAYfKTIaUONKpbdaxa72r9RasjdPLZnOREqeZBxZ51XYX7E7W0Isdr9o\nptuzTRQDssXRNr8PuDUHeZU7lB4gqMkTLVoc419A+f460qNcHBbffqhGeFTF\nbBjt\r\n=wgkA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrWqF/92OA5LtBtPvD1G6COiIpbQJxq5Rv15/5UTf/mwIgVNDeQ7pR2KU9Va8ZoeZElxSvpPT6jH68+B2QaD9SeQ0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-2f8dae2e0477510ee4257b314d720eb176f19e56_1535562446687_0.25671894253280003"},"_hasShrinkwrap":false},"2.6.0-beta3":{"name":"alfresco-js-api","version":"2.6.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2f8dae2e0477510ee4257b314d720eb176f19e56","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-beta3","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-qfi5hsSzo0q8J2868jK2Nye4PWZBQU3ZeFvVbus4etpnF/6YjEfmeQeFkfiupXgsorub2q9UE2e5VMSMQTO9zw==","shasum":"2f3c24c3f3255e96addeb1451a4ce78679c6dbe0","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-beta3.tgz","fileCount":1178,"unpackedSize":7054934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbiUqECRA9TVsSAnZWagAA820P/jSgWsapSDKXoQSpO2QC\nyqZtjKcbE0zAHs+itaep4m1qx5eJWH1UzXd6YFHuUQsaPQ4Eexg0zmClF9uu\nZbN0EJFP8PjTw0uYir+dL31BeffUQwpCe0XuVU8S7LmDHWUiMFeHlN3afCDT\nTV62Bqofa+m27YoeWhw99pbiOq/6ZIZt0bKT8C0KCK1ugXl8ze+QmM5KoQJr\nuGJRcbBryQCrcxt+AL7t0K20up7B4jzlRc9r/zbOYDfPUp++vJUduXoj5DDU\nh3ixo6riA0Q6FdKvLk/9EOx69csmalpjdDsiLiLcT7SPMMEpo3RucZXZ7/pp\nGeIxMwPtz7FGf6dy31YZJxSBq5NyGgMfiMztClT878bv/h06SY++u3hCmEs+\nXvG4sjuR4QE3wDUHyAVt/HxMqQ5EWLhU5FUbFYkNDWP2TBN5CWK+NZUmh5GA\nhrMSyv+lp80Cx1odJ7mDqR736kFbdM73F17y1Z3rch3nrSkReHh6Bq9By7GN\nc0azcs1xlVc24huswk1qiCM/fQraKJOx3e6dWR/JimwikuaSAo8IhTdcCZ28\ng5gr1U71wtytUyetcY1zPDmezzERU/aLyPP7pF8okDiHMDHOFR1a5cMaggs+\ncjesRsWFT1VCsZKeleo56veOZ2JCKUNSRkxpwKl+dZSH0rhUXkt0StiXUMiM\npoBp\r\n=JaIl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwyDWo7wuqK6a6Bm42LUrzp/ciCTdTH/Sc3JYauMk52QIhAJ36zrawCZkrNfWcQ3QHfQVl7pLcyDraJHy/dZQ4rDKh"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-beta3_1535724163478_0.5879646247757226"},"_hasShrinkwrap":false},"2.6.0-ae3a3622d9474691bf90b1495282076224e36ecf":{"name":"alfresco-js-api","version":"2.6.0-ae3a3622d9474691bf90b1495282076224e36ecf","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"ae3a3622d9474691bf90b1495282076224e36ecf","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-ae3a3622d9474691bf90b1495282076224e36ecf","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-FnV5PcfwDkiv9+/uwdXXaxy86iUteSArv029VQIy8j+nw/6qNJ2Bj4WaL/JGapiVdLWWSjhsGx1OFLKO69kBOg==","shasum":"327741597ac64281c9e83925ccbe64e2706a4425","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-ae3a3622d9474691bf90b1495282076224e36ecf.tgz","fileCount":1179,"unpackedSize":7055354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjprrCRA9TVsSAnZWagAA3fcQAJ+0j/rgH/r78EX+BtI7\nUfSyG/OLJaW556ZLhssHLzE+w5dmSw3sNL7xoYq6GZcxdHW7ZQJ8zb+wcfaO\n8C4MR7G3B5Y37x9LikigIALAWN9dI6IXxEg+GEtQ9EnO1uZFeuCJCtPwxn3o\nKYiiVPKTSX480XXDHm8/l+bjfWN9uQupqPoVJCRUcnZ1g4iRCOI+dNxhhZ2L\nC2NsNcEiwN9Lzfqujk+7H4Nmkl/ElWtAEeUvTXtVYV/WTQqycFDyNHB0maHl\n+J/Nw15P+hdEuJydFT9ffQZQX8d4H92O/Yb9al0U42PzyRHgZEDgUtyTpMdX\ntqFJwka5mKhvoDKITKRBVPQq8WbLfyCW+IRv0SYBI9pOMjYbowIc1V2aGi2t\n6sW4gQH0dCz6lRxniylRWFDmxKIORSLNqA6hcNN/lh8HZSXeU/wue1PGRBqB\nARR3glOw1Sr+BP5s7OoBLgIwO2W1IrJTruCf7gaFXooAKzjZcVGpsNFK/B4K\nksJfCCC6L9yq09HwEBaYuRdpgfWD6AijuMrNWYlQY8Y9+1WBBtrkm+2XDM5V\nU4wbuOd5ZSzAL1qCoh6l08ltoScWV3g006NO37UB5qMSrBQsJrxQsEziqsSZ\nKL+o+AiqYFYzf3DyWeGRV1I84FzQO/6KcTgYkEZmCe1BtmUV/EARO7uyKGn1\nIUKA\r\n=G60s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDgjDXuLO2shJVX9V8wwOlPk7/LMo5uGgCiVp0r0+XM4AiEA/lKaflEvzkBzXwy6phvuQVgObXXFSmBYrv9kTfh3ht0="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-ae3a3622d9474691bf90b1495282076224e36ecf_1536072426602_0.09365065523186589"},"_hasShrinkwrap":false},"2.6.0-094fb2feae6a25dba3e4d22ac08678529ea9781e":{"name":"alfresco-js-api","version":"2.6.0-094fb2feae6a25dba3e4d22ac08678529ea9781e","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"094fb2feae6a25dba3e4d22ac08678529ea9781e","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-094fb2feae6a25dba3e4d22ac08678529ea9781e","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-lFjgPcu7ysninfbclpuHyh+FLPF804uqXXrQ0wT4Io2DR6h/qI05PocrHHmksQKj0elM8Ndy51Geula0bBUULg==","shasum":"5f9ada5c84e655ea3c8c13746412dd38811ae6a0","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-094fb2feae6a25dba3e4d22ac08678529ea9781e.tgz","fileCount":1179,"unpackedSize":7055354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjpxPCRA9TVsSAnZWagAA+VwP/0NYjowFbBN0c0maWsWM\nmGdXEI2TC78rlaKeQiLEnNriiUfSIa/Obc9OgcUYBezNR1bC9Dd6QrvxKwB/\ntezYncXF2t82mSm81jvZkXgez2Fa++dWKc3SdruepmBukneu8OKbn7YSPup6\nhD8zbSrbsWnMVdkTzlA8WHX3KB4qQ4otGXrxn+Zmry2bCno0Bbq4DkBdvUBO\nGnOjxqNfJuZ9xSmavB6u5jsa0V+lY9D27VOfQeK4A6Bpntn6t7sTrTcaZqJJ\n7FkUZ/5ZZLobkGamOaci6rUjW2MTgsOa9cvQvxCOeqRNiVGZhvYQWkPSRejA\nX6Q1y8gy+zjB49XcKqmRBvnDTlUlHzZ3luIPGv0xdG0BUf1jWeKKs8VF9eth\nm8HFriGq9ay1sYZeKQNOqjF/+7W7p9FUOhxhn4qZuiatmIIwrOCGY6FTxjC4\nOv4/wBNCVL3NcYFhbE6t3PWO3Oql6Zm4kuRB8xYuF3drvdzrdX6O6Gqgxqk1\njCls7dSlptlF8H/1rAEYkW0yyAQldZcvH2DxP4qG+j4aCpMqmuC5VCCEvNzT\ngz/BA4de+xkx3Gn9YFsJbjnW7gPr5tDDLDmDAYPF3Nq6SAoYgzCnpOgix1ec\nKXwmW0tIg3aRHbfduTV6fXO+coO66kAisSxWGfbbQmqhesqVfr7P8pdaZO6f\njKFC\r\n=DEP2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTcgzoPZtH9eXo+juNAVJkqeGqxmERIj/l2dE5aeVXeQIgZXDcqjYt0Ay7UkEYiYezWFFgscLdWtE3c91o8Eu0g4I="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-094fb2feae6a25dba3e4d22ac08678529ea9781e_1536072783058_0.026831147884281537"},"_hasShrinkwrap":false},"2.6.0-c87428564306f710159976b0d740a07a94326cf1":{"name":"alfresco-js-api","version":"2.6.0-c87428564306f710159976b0d740a07a94326cf1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"c87428564306f710159976b0d740a07a94326cf1","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-c87428564306f710159976b0d740a07a94326cf1","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-OPt75wllx+vjI0RgwbVdvUa4gs+UthJUS4iVaS8PhyXhXNxEHMuv2bKGH48cSolQbNH7kaurxqi80yl8b9kw3A==","shasum":"aca7a746dc7298e9a1903c40a9aed4c5a9bf5cbd","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-c87428564306f710159976b0d740a07a94326cf1.tgz","fileCount":1179,"unpackedSize":7055593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjp8nCRA9TVsSAnZWagAAtwkP/iixmxxYWvboDnfw7HmL\nJfnRVcMle4QSHsJJR4vGiBjAgkgnHhJflsRDAmrcDCOYDvSEJFjjUmm6wD/m\nSfmQZkDK3S4N5D3yPlv+iQAVBn9ak3o7y3vCdDpIHdcV4OsAb4oNpYs5/L8W\nSKFp25v6Ul0Vlapd4uj7LNObnLpk326VmE+Wec/c6PrDcpCDpUTQr3cKNshH\naA98YlyPuDizb2lTjrWQPCFLJH6cCFcwdBV/jxnfozlBCaeFMdFkAjYkH1SD\nYsAstt01H+UGy7Nri6vEgDycCIypPwT2KzOOEmtKibH+go23PQZ+IDkgCMIJ\nU1YGC3gDeXjfaDy+n3cSRLEYEq6bxOtP7BM7SWD6eLkiIOqgF87untxpgGDl\n/XPdWDenBTQ2YXOZYI/RbglikwS4mpiYE1MhUD0b5hXaavdlhPo4bRX+uzdq\nBvOedeWC70/bDW7ZQs/+AKEQJpxm989bJqtXA0B+QK+nnxTVlMCfRmqXYCbv\nP/wY6MLtOpvG8Ke/mcdmuf7fpLJZJxmSJOXaSx4CJllwbSPPg9V1czF5pCiy\n1M3rxk/kaVeOV/6A15v4Gs7/V5ETj0snkro451AKsHhms4+SoUROXbtbd84r\n92XU/rA4Uwpeyv6auznhIZ/+eRZtF4icCfAsgsMSUVFWIYME4TOd3g7opU84\n+hJW\r\n=v/UU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIByE9pkqAewbfGL0L2vLboVvskshrZVjpyXsAT6lkJqBAiEA+htoeFXtcv01Ufm5u6WkvlPf6rGRtU7NZWEDAaBokic="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-c87428564306f710159976b0d740a07a94326cf1_1536073510349_0.8594157042602455"},"_hasShrinkwrap":false},"2.6.0-beta4":{"name":"alfresco-js-api","version":"2.6.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"c87428564306f710159976b0d740a07a94326cf1","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-beta4","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-B4h42LFUL0WCBxM4A1h3YnbX2lZyL6OU4a5HUTcQj1q/Soy8YDvzOKQoO37W6+ZYcO2B32AuvKGIghL/wsM6NQ==","shasum":"2e2fc7f45837ad0e6011f93da798c092e2294ee5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-beta4.tgz","fileCount":1178,"unpackedSize":7055488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkoV3CRA9TVsSAnZWagAAR0MP/RSDG9KeYAfDubun+fqS\nP8IvwJX4yoEVITbfX+SyW0f2qgIqN+0YccnyFoFgJX6cNJxP4Y40XnPnsNGZ\nCGntGtNt7Vxb6OtwfLKvAkGQjeep4TnBBUqmVJJHHxk9uB6pm5BLYFf6NCVq\nzjQbuQyYAaMBdnZhS5wZvbmZy5rXFzG/cdg8CieJqo9OXYAMjrI5qhE27RFA\nR0KtVSqGFPPrc3hk7KRZUmGhoKJKEkMZf6Kc4uZ93AqPzgnLF9SX0a0KTS57\nUFtatbvyW04zEtL7gX4xwjtpNhfbk+HgK3mG/5M8PFUatG1ZBGzKemF7gZ9A\nv8x18auqCYPTd7K3S9GFDDrYawQRT70MZa1AEIaYDBlboFIkk8dxl1ySf9KB\nXWLjePfwDo3at4IvXrrNLFaGCNil8/sjgHsvKizyAIYIZhqEkTlI8tsv4rKf\n79MXC6S+i11ngviFu5uoQ6gsg/kBawaIPel8qAaigVWuVxSWCwaLVsGYjzKD\nrXFsDUIxDAo4UDP7R7L1Rl4NRofL0AMCx/ULr+r+8vuP1Gx/BI/Cdfu6wr7N\nXqXyKEe5yaPbffyGZtWGJdI9YYTmaiJ5hFHLA1Ck4MZwapbze4kbZDdm5Tbj\n0cGbQBf6svuRdBCc2OSH0alPs232ohj4/sYDKSHfNq9/vdo38RY9cNHjyuJq\nhdg7\r\n=g7U6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDU1XKj/Yh3Ea/MDSEZwdtCqXfUgF1tMrOXYuJnouzceQIhANb2fydL4MJ8QhtKAnkJyxmWp/2cpW/lrQ7/lAI85Dsf"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-beta4_1536329079120_0.029768866234297198"},"_hasShrinkwrap":false},"2.6.0-1c0a85da20c8935876a0de499d6557f51cea1d78":{"name":"alfresco-js-api","version":"2.6.0-1c0a85da20c8935876a0de499d6557f51cea1d78","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"1c0a85da20c8935876a0de499d6557f51cea1d78","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-1c0a85da20c8935876a0de499d6557f51cea1d78","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-XoBuw03e86ZNOCLhu9rKl5lyHPb2UCO1Zhzo7ChPH+Owx/IA8r1jYbdi/dEC+1rUC0B6gGAtRjhiPlqVOMkicw==","shasum":"fa1e0a9300fcfe4efa6a486f433882bece27dc5f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-1c0a85da20c8935876a0de499d6557f51cea1d78.tgz","fileCount":1179,"unpackedSize":7059609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmQBLCRA9TVsSAnZWagAAmBEQAIAPHuj7HAqM8RV4VsUp\njRoI7KYBd2UpkOCwyA2eyrs/TTImtvPUkRwnfMh8oTsLPjp+LQfcZQcKv6S8\na8+Qozr3e6iq5MHXND9EPQmRsUJkDajDEKxU7D4ai6yRihiYqP9z5cI4VvjQ\nyqUEDbQ5sJhVY6xemmB7G0HaVQGwCkOhxFGonJJxCBi9GnmZehof8o5uVw0Z\nl3InUQ/SYrhZ48S0920nmlGH6rzT7p9qI/3zY/nzmOWQezC81moq3VwXqjpW\nK1a1BjfmSpLEc+iNKZrT8hlIozC9ZFj1Ajkgx1M6S7k3A4v7DMHHuEiY1LJA\nhb2HRvmXKBKl8YCCQbg0gn+SPClMAkkr0DYQptl+IZbPgRYAytLZ4+Vz4E0Z\nCvoJCWfRUr9pV88w73Q4sC5qD8/3WXKXFEc4FX/kwH5uEthvlyJk0XUEwFZY\n8WbhGHMccY0G2LwayhYW3hWZs1c6QdUanwmzfDoEdPsPrZXYUFgx5xk8Himx\noFNV8TIiSNGWmFvmbC7Xvy7pYadgCkVZHs1entqUInO7xv2xtGVQ7BtYyWHy\n79kC93IUFoMfm+V0UYqushapOToLfPcEtLR6GyYnCcXBc+TlyMfe9inmhq2B\n/ZTo4/eivQZmQ2H/+M7DP4+np95QeLJT+x6w6rPAWzWRTkwyL4sBBKBCsrA5\nyaXd\r\n=Xt62\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWLCGY2srnb4h7jVadpmmunWf/0elfvBiDxOaJgR/pcAiBL7VpWRf+qwIaRfb+luGZ6miMZ7nPvcdNTTZczHckz1A=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-1c0a85da20c8935876a0de499d6557f51cea1d78_1536753738455_0.22038176977783275"},"_hasShrinkwrap":false},"2.6.0-e7a6d9d6f4c88b7ff787a43702d77a2221bc4933":{"name":"alfresco-js-api","version":"2.6.0-e7a6d9d6f4c88b7ff787a43702d77a2221bc4933","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"e7a6d9d6f4c88b7ff787a43702d77a2221bc4933","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-e7a6d9d6f4c88b7ff787a43702d77a2221bc4933","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-UuJHDPbOOosu1FTgXS48+qX5wiz5mTS+JM3GVVgFTGUgX+lTPDx8E03+lTZqC1sdNo3OkTmwLEJ2Ocp53rv5sg==","shasum":"8efb9e6bcb89fc0faae1458738ddf59e9987504d","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-e7a6d9d6f4c88b7ff787a43702d77a2221bc4933.tgz","fileCount":1179,"unpackedSize":7059833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmT1zCRA9TVsSAnZWagAA6EEP/095SUYLGh+sc5Q1u8Ol\n6prFnG84FqAIfLQxYJ59Ig7QbazsYU/q4FwRk0kGcf43AWr23mKtI2FtAfg3\n9ybwWRRZVaQvkkbB2gyYsmzPBMdRkxfSHTzKZ9cfI/zebjGo02FLwYmyuRtm\n+n9k86xE+/wdBFekekT3c14SQ/2bTJ9BbsPQ+tXCMABEw9K1oCnbDkYI3krQ\n+7XjlctFKPem1NIhFqznhKe5Dn9NQnIGgxXhu/8KU4WXwPklzmHkMlPuydiF\nACQ3EXMyVrhNnrE1nzcGooy0EbkxLsMFcID+tIL4DeqthjFJn2XwunyBQ48c\ng8YLqNO8XKNJHpte+Vy7h+t23fiaQvuLFs/ATBSTKrAxBB9S+v1TGjZPOUum\nLatOARJg+QCRFehTTZ8bge/E8sEpoarqoBJiJeV3W2ptfi7W4O1zlF2tp/TR\nlwXZt0hCEbdN81RmBIoB1UP19+iVN5D3boiTsz8iosGBZO7Gz/KqdHKOPfjq\nmiax4h3XzJIl4k76b7bPX4UzEulIdprPnIKkBkDfp5smvUYcHbVrIInqSKSI\nhbMub94TD4LpgKNNLsXab62Lk7SPhF/ay6jRl/MDPabvwiSRy00V6S63EPcp\nPjmvdAv6Y49EkmY6dYlBUxdeTZSd4K2KY0O7P8Ht2pVrn+otQGsNMXYXvN/x\n9LUN\r\n=fts+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICzeMLc3YFsf6DmfwY2rLYoOLx/PSg4o6pSz53+O7eQBAiAp84RQN1I5AfvC7fA/FE54Lympqwv57N3RfpI2IUP7vQ=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-e7a6d9d6f4c88b7ff787a43702d77a2221bc4933_1536769394394_0.2222696930294803"},"_hasShrinkwrap":false},"2.6.0-48ee903f46585b1f0967311bde867dbe8ea9374d":{"name":"alfresco-js-api","version":"2.6.0-48ee903f46585b1f0967311bde867dbe8ea9374d","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"48ee903f46585b1f0967311bde867dbe8ea9374d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-48ee903f46585b1f0967311bde867dbe8ea9374d","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-v7eahtOkxQD+jywQ1OQsSLdhKbFw9OLqn2ya+gGWbp4k7eAnUPdSmfV2Hahli0nYk0zVI9mhCt4u+Rqv4rXu0Q==","shasum":"f352233941202a457f1f05bd8d30de5174756861","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-48ee903f46585b1f0967311bde867dbe8ea9374d.tgz","fileCount":1179,"unpackedSize":7060020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmT65CRA9TVsSAnZWagAAPhYP/ipWBn0NPAW9Ael+IE4Y\n7Grf3tuH4LnIHwTcV86qG8x3uD8ydXSjs/Onx78hxUEkDb5q2eS/0JW2eiDB\nbnzr2ZQLAGkrgn+K/GnC1Ka3FOhG08omKMZqj85llWRc8roh3nuET3XD9tKL\nPTCU4ghqGtfJ9NhU2VJBxt9FxFvIvXWuxtbsogL36+m7PkuuKQnsaK00ZmT+\n2FPSoPr5aI0Qh0veQpKJWiFTIDn6kaEpVwGp+Z48//LDNiZt0somSqJ/MhmL\nJ5AiyRRa7fWOzWiSkEE44jeFipIwi/qUiCCz8eZEVS9z8u9av+AwBk+62cKi\nIlRfVf6Gg6AsemZtw6P5QYlGDelKDilxgnsAvEdrdpyV7AmS5m+03o81/K95\n3SruaxA1eBwOZbVUQ+V0/UrWiJ2ldnL400c8Ua9Rjr/hIvAKm+pYRQKPenH5\nE5bgNSDqnyfYQEoDPabCAGKKpOmSSKLr760YrfqVqrfthPnXINFN8dr/L9ae\n112dfRyY9V1p9VEj5sWrTRcNHpxy17b4duZR0MqsrN4ld3Jt2oxqOhz7pe+a\nvnI4mYH5VoXqXgIE+4my1Uhl9hskrKSm3Ml4K+83xy8xb5aHHZO1seHMh1Ak\nvUZxJu4gpr/XJw8cqDpYSL8b9Q7Kp2+oP4zA9+uiS9HNLMCRiye8xu8NSsVj\n2J2+\r\n=DCMe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIByszuATfKTozlMRFswXsAL8sGTdorTLsqMxsGYd433OAiBEUMVCqPfmiWZIfRKkq310bCYrfGV4XMGOBjGWSI6Nkw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-48ee903f46585b1f0967311bde867dbe8ea9374d_1536769720778_0.8527460599484316"},"_hasShrinkwrap":false},"2.6.0-beta5":{"name":"alfresco-js-api","version":"2.6.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"48ee903f46585b1f0967311bde867dbe8ea9374d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-beta5","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Zc6lVFboFSwL38+3RB7qRX3J0OZqy2m5y1LAVUO+/npemWFPFZkF9IEYQJHxCgPvAP/vpDS7f3C20W9PmlvESg==","shasum":"1befa76c95df6cd35329bbccb1381824d6faef7f","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-beta5.tgz","fileCount":1178,"unpackedSize":7059865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm79+CRA9TVsSAnZWagAALasP/1QaC5GVpyWlOTAu5hXQ\nwTqxe6ohIEWVW8QykZ6mCtW73bbBcO7LOs1xg+jhNQIMeR/FOIn3Mz0jUeBB\ndZR2tTaJ9UVJJ1lxgN/fdDSM5CmhFEAn1F1Dhd1KREvPlxanPIgcA7xg1vhK\nSh6dvMnLoW+f+n1RZYzayCJrXJrAwDTZF+QmTS2LsBrif6HOW2cn/pmXoPB+\n47xCFTOBj+fyqQUWMm2MHS0mEpM7QWhIQZkJdpv8sENshRBgoI3SSdXYTGsj\nONzKYLmpA6xCtDrlTONlldZUqRg3kLUzCEpXqPN6oBe2BRmoALIqrANpyEel\nscwY39PtcR/7M8EVdMp3HDYngcn9THxrc86Wxpqb+WDEzYqQ6z54JPc2pOwg\ncExF0xt11KbzkezhxwCRVuPitSmIsT1rtbPIT23X2yzZwQyBIkbHkmigWtgR\nV6fYceECclHhPkkXpV2CvuaxcKFO8+0333J0LhpkSw3zqTEfyAsCSxKmKUEx\nSw2YFcVE1LELR92NaqThYo3lb7aKUG5KMaCkuC5Dc1wQ2U7H96h0crYoqL4q\nPi3l6MAoLEgZ6WF8t0WA/TQgec7Vjq0jafPNyUfVKZmcVxSftms/tHhNgN5V\nwU+/alrn1GtGPCWKEbI+wf7Rns4UEHojnFtptHNxq7cjxuMTxotTo8VTGv6C\nYgl1\r\n=bfEp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1g/cGu2HokvPF/4awcquWSmLPZLJvZgmRxFwZB3lZIQIgJVzTz4YfO5MxEdAe58frcc4ZOdvH4VjcCHhE+DoaySw="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-beta5_1536933757764_0.4493043199228044"},"_hasShrinkwrap":false},"2.6.0-e0035744611f12f4f0067495615fa37ce392c810":{"name":"alfresco-js-api","version":"2.6.0-e0035744611f12f4f0067495615fa37ce392c810","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"e0035744611f12f4f0067495615fa37ce392c810","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-e0035744611f12f4f0067495615fa37ce392c810","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-PCdYejr7U69JUH5BIGonnCbNNwcZ9S3v9Nhpp9/y8By350SvTePLHD/vX8bbP9rq7pDpo7QqdB0XhQiMmtckrw==","shasum":"e93007159e700d41dc5174866e8e1084d28e96bf","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-e0035744611f12f4f0067495615fa37ce392c810.tgz","fileCount":1179,"unpackedSize":7060960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbm+gpCRA9TVsSAnZWagAAdh4P/RklKahGtyiqxnQHuHzk\n8puCpd5yQvebR1Fu35wTsLW0E0GoGTjgYqgNd9Dl/0bjxHtigYzSF8wktSpA\n2bWXa1qRYcnWna8mpvef8PFlTKjLkWW0+vMMQVj2sbKdWUA1ExWU0Q09J2dl\nDrP1xWLRlKiTk4nTKg8DfHStDxzC3gSgUMX+EiH2nSARazsUk3i2bk/RqflB\n7f2KzLehhMMv5gzC9j3oY+hYwwmiqed3CWxQgg/khAdodZjadXORJOHFWvT0\nhAXBWbBv9GYo/i5iLCgC7jPPQRqZLPylWqtm4S/fwdhT4wA/u9wKFIFbUWS+\ndk01MJoCTZYYwn311OSuBwNvzDSWkDIBKRgCmXcwH6VWlNpRfRh7/P5YqgUv\ntDCEqfMBasW9EoFGacE6xNyn9yow+f+7xDAl5n5vG9pvAu/GypNS2V4gUmEO\nsrgx4gs7xh9bxa1HLWIJzdHujJtT/Y1uufZb4BuFXqmIySl5wwjuSycKk3rA\nXB8bpYlbYPpZ2YUkfnSwnppaEPLE8SJcEz1b/Iuh4gdtWHBC4fYVLEf4TICc\nYxXVs09e59CvLjWEkyCCgNwWwVx1Ycb/CQlTzX0ttybh21AzJcdVVRmhIE18\nyQ+Kxq6DGHoix5Jbl01/Z0vijQ5kqnjwRTnZJdQj19iiD41EAZVfXs9UNp6O\nEB2+\r\n=z/mb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIECoITGKWR6IcP4DqidFTVZhB1iNnGzRYyM5hDjAxy9VAiBvlm99mRrcuxHR9LbUW+mxNYyN3D20cKmeiivh/GCp4w=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-e0035744611f12f4f0067495615fa37ce392c810_1536944168113_0.9173763816381997"},"_hasShrinkwrap":false},"2.6.0-a2a61de6bcc708eb3bc87de604b58a8749a973fc":{"name":"alfresco-js-api","version":"2.6.0-a2a61de6bcc708eb3bc87de604b58a8749a973fc","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"a2a61de6bcc708eb3bc87de604b58a8749a973fc","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-a2a61de6bcc708eb3bc87de604b58a8749a973fc","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Gftyuau5ZUQBqJeKvndVAaxeyWJO0TZnLxZ8h3y3KyRdaIVfikyuMrL5jgJN95p9RkbOOOPtvwlQcx5yd/9Ifw==","shasum":"6d4286947cb7c68d50d8c7d3c9988a2cd7e2c4f3","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-a2a61de6bcc708eb3bc87de604b58a8749a973fc.tgz","fileCount":1179,"unpackedSize":7061019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboSEPCRA9TVsSAnZWagAA/gEQAImHWDwMFQr2g8ScxSGY\nq330nKlqipoVJKIR5nnEfQFBTiyqOO24AiGcnZUW2TUXiT5hTE7yY83dRsDM\nqXltzKQ7xdlVDKL1a+sRp7aS6FEjzj6W/FpaT4sJZU+GWJKXWAJ776K75qLT\nxBON/kgtExSixkw9X0h6GpnjnSTM3rCcQCiDqR8jvgEbZHgIIv8OuFfYnyyc\nVjngzcbcxVocWgTg+1mnKGye5I3ipMnojD6CU4OTbvUE0rhEbFgZ6KEU+qeR\nEIobwwy15WC2vlMwuMJ6VW23q+6TR50XXjlbnaVHrTtgEgAmEUv6XBQUJuhg\nHMQXy+tq1t0pvMW3KY5G6S7gvkuawAh+vp2xEInCMpvR4UUgnTMZGMRIJ8Du\n8/T9yV6VEoKoE4FWk6d/T2gdt6VoSomPN8bc1H/DS7OJ1pz+GrVlHUOWdYsH\nThwFbbGDSnizYaZARLHUV0MzYN2yso6wy3gEEDIVznx5Y5lVWIKIU4vb1S7u\n3R3vbZ0jRBKB1QfOGcUc6BXFMFtq4ZNt4qWxEBxCgLz4R5wA70xTiYMU2etl\n8aD6rad4h2IF6D72tr5w/+R7AK6PzE4CrBYTdDp66zU99QskLjfwDMobBj6I\no/ECnd4/WBOAvyvesHcdENFZLLu0jsJAtHRXJ2xarIOE/kjjJJCsZIrSVaMy\nDQ68\r\n=VGX7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKVTS9tgvbgicIqH6AG9aDNDbTwyDi4fIMOrxJr9cRrAIgID8/Htdo4NSoUKRXb5yHOXQq1JU1nElQYjOJuXu8Yac="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-a2a61de6bcc708eb3bc87de604b58a8749a973fc_1537286414741_0.15642313741284197"},"_hasShrinkwrap":false},"2.6.0-6e06c134e4d29ccf8cc3001b330c57ea0571e58b":{"name":"alfresco-js-api","version":"2.6.0-6e06c134e4d29ccf8cc3001b330c57ea0571e58b","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6e06c134e4d29ccf8cc3001b330c57ea0571e58b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-6e06c134e4d29ccf8cc3001b330c57ea0571e58b","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-98xtHatgESJs/df5JYVbxisaarvOms/4JVLpgamx3El/ZzkoWrp0Og2K0CvKxxqNBK0aqD5JuxlcQ36PVPaPRA==","shasum":"3aca13f9ad6653cb1914d1dee403081eec0adbbd","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-6e06c134e4d29ccf8cc3001b330c57ea0571e58b.tgz","fileCount":1179,"unpackedSize":7061307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpPi+CRA9TVsSAnZWagAAnRUP/2Hyky4NfRWQz8+DM9TL\nRcN3PmE4/lCxo1oq5Z0X9zMEMM0Z2XjUa221BhLe8MAskq4hCqyCxd+4iUz/\nLtxP9ROZ21VvlrCezY1gYbX8lxuR2buAXzIwRce20CD1sdI6Dhj0gxLlTml2\nf4Z44qbbEvFLR5na4jYeDApMhZh+wEMlc5zvqsUhtPCKn2pLqsPizOCOaihu\n8/UnTwrZpCtYQ/BTbHxpbj5MtK+gFAwP4JrYWVv7TXCVgpKdjQiENCrtc6bO\nLqQLlemU4rsPuhk2/ePbbUPwnJyERbe6XlIGqR44qFHZyTr/q1KAqAfFVM1E\n7tMEy3hONkjYXYM+NIAW3H7+0iZ8dPdf7amhAOOoRQalUOeM7vVd83oarBMA\nMRNER9wyBCMkAEnATLMpp7qZZRBjbkCTdvu7xhIPfXeKtsDKn/rrobagZ1iG\nqoIymlnm+A6Wj+DaMIuN61OjlKgzglwlTO1RaJzblYTLb7MGYn5OZKKf4u3w\nW5lexWqdMfzRkxtQflB3NotGwpWQ39LV2Fgb2EnxZR3YpJ9Tx5sZisjm+S1u\nS/5+g15JyAqxVMtf8Lz3wnQQWkjfecTuC7HEB2yuSvysFd3qvm/5f1ucNI7u\nrLZctV/q8To7lKyMC9usfvv3rgDGQFB4XhIQo+LoYE52TV60LKjvcCdNFlHY\nidvr\r\n=+rfW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPzjAr+EeXPp4i70fQO3myFlWMvMfQtGD5/tHRgiI4lQIhALS4x2Jneoikd3fF2U2lzxfZuAdnGKrd0BCuNxClsfIM"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-6e06c134e4d29ccf8cc3001b330c57ea0571e58b_1537538229352_0.007691437549447233"},"_hasShrinkwrap":false},"2.6.0-beta6":{"name":"alfresco-js-api","version":"2.6.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6e06c134e4d29ccf8cc3001b330c57ea0571e58b","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-beta6","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-T4S6zWBJtZ/Zb69+30ZrOOOfCgO9Vmd28lo/bqg0sZ84s6ZxATqGaHFktZVxF8kUhg4iQJxzYj3ubmCI9fQjtw==","shasum":"09ec6c991eed1c0bc72ac1cf574f914a2c5d9868","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-beta6.tgz","fileCount":1178,"unpackedSize":7061202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbpPqSCRA9TVsSAnZWagAAliQP/0PVVKiRaZ7mz+eQCmdL\ny09kqdg0rTkw7/69Rm/Js8rFB29ZE8QxSqQnrjlR9TaLO0Kyp8z5ACkOVfGb\nxroaz2PruRAap68Atu85DjOf7jNCznDRKGL0yRjb1jVqXHAVv4+caPRvLjWH\nowEMnS/qGItV0zP1LgpMfWETiku4gSXFuy0GBe2ri03tS4Y3niJwYKF6TbS4\nzl3tW72giXqUNj0GLNclS7F7+wko/NZBf7orqCDeljtQb5CCjQyr4uiMEjAA\nFdjIRKLBjmByMrjq+Oz+B7ubvwXlzIe1nACvSTvMC1hokj8bdoPbJKY4uqek\nLWXvrgow+PM71ULlIrCsb3JuCCMsE8JnTy1istUMoBfdtL98MFeq6piAHJhj\n/5aNej9k5OqVvVrjgc0utCVFCehl3pvBa+x9xMpJObR5OjSU7/ISRWPxqEaQ\nkN40Ebh9+g3Yd1FqDDVia8EkxfsxUZs0ziS21I0sPnoEDx1PfET7dsG7MvVr\nsLw6O4Hw/ZxU58cDlYScLhv/JYy+O/PHlpM89Qr/E/9owF2ma596817nPh56\nHcb8+8YjoLfcNyUv7AjNqec8f34HxeUsl8RfRYlmN0DcMiC3+fuEViMnoriU\nwFKbtUr9dye0WmIEgUOaxqrvSs1vs0pBa7sOTw85+CPOxTqFYuwWVxfTbEam\nbj7O\r\n=asDn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBwUcAoBQWCoR6oWN/Ym8wBPbGdNfzaIdnEyf1ir7xgqAiEAptwKnTQbc9RdD2HlhKvjMmy3wHvAH3KGmGw3x1TSxWI="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-beta6_1537538705895_0.23930529051567073"},"_hasShrinkwrap":false},"2.6.0-f63bc88452735de16bffe08355b42fbbb4263aa0":{"name":"alfresco-js-api","version":"2.6.0-f63bc88452735de16bffe08355b42fbbb4263aa0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"^4.1.1","webpack-cli":"^2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"f63bc88452735de16bffe08355b42fbbb4263aa0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-f63bc88452735de16bffe08355b42fbbb4263aa0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-Gmy1OYo51aPbm0T9YS50sw2vat87dJ08d+wdKQ7gGZwBZe2tb8EFBspxT12ug65KAh1AZfZVuR0druYI/LniAQ==","shasum":"612a9242aaaa372e21c573f00e3fdab1e9a9c9b5","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-f63bc88452735de16bffe08355b42fbbb4263aa0.tgz","fileCount":1177,"unpackedSize":4802820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqj5ZCRA9TVsSAnZWagAAgVgP/Ap3EZNNPqKEBUAYsA3w\nC28eu+Ia0vYTYL8uHAxQn2926CLiVGUne4Uy8U9h8GMhHR3biDoRXK7xxOrk\nbDuMVOdCFp4XAINgL/ni9a23pc5SjKu7Rz1r1qvDZbFwDZBP+nVqreEMVBjU\n4cIi24xEcQFEi9LPPAYEmUc6Xf1cRnOPqPW73DzZBpXihotKMGj96DDB/UTV\nyd2cvcXtuLLcGP6dDU/9TjLHL5LhCHrH4SGpfJsMnnZr2eL1JHGYbamzAiY7\nEvEWcthniJTsDhQ/TyPtkfb/NxRRaOOFLOnlDK5CsLNN8LIO/WtwupOTWbEw\no8cYHiJILVV+cus+YYBi3r281TloSR30Mn5jVj2d/eF7DM1YdFz7hSJi/tn+\nyPczO6D31flODTwDkZA9C0zp7swn6BZ7C64NJjodwtoSg72Sz6POiM8367rV\nkPZBDPm3G9wUpoAKKgQaNpJAumgbCkYZa3l+igu2qbqi74JV1OaRvFmVL8uj\noFi+fuelCHufvrzY7RSfDfbSdik3ldypfEUE7MLL1IfTYZzRi8r48poEbsHw\ny33ueCacerUZV+2QrfidGMHlvXqhkwke3BudMDMyHAl9S/XVjxFs8/cbRMme\npK07c3UVcre/zmfg1guas+2jUlTLwbwWSCfBoSy69JHPws46eriH6kfiLJiW\nJcvS\r\n=np4N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE7YLPFBArxWrkfr5btnsBZZFOPI23ODlBKXiauF19UMAiEAmgV7/vpqcINllZ6Et6Uvz669/Vn9yFzXFdhOhQG94sM="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-f63bc88452735de16bffe08355b42fbbb4263aa0_1537883736893_0.1914803633657225"},"_hasShrinkwrap":false},"2.6.0-bb5223c2ddc753153d69deef8310cf79d48f1f48":{"name":"alfresco-js-api","version":"2.6.0-bb5223c2ddc753153d69deef8310cf79d48f1f48","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"bb5223c2ddc753153d69deef8310cf79d48f1f48","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-bb5223c2ddc753153d69deef8310cf79d48f1f48","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-+oZS/BT/X6p8qLn7+I1yyBQZ8LWSR62IpX7wHFyyKxAbEZYcExOP4s0r3+RQsze+qXwCfdRZp0q6krFlPUNTvQ==","shasum":"ac8f0437aef4ee7cf78114241075e86c8e753d9e","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-bb5223c2ddc753153d69deef8310cf79d48f1f48.tgz","fileCount":1179,"unpackedSize":7061049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqmHYCRA9TVsSAnZWagAA74cP+QDJiWmtHM+OlI+cHzWr\nQJw3Kdg94BDhsyAGpQoXrBLio07mCYae0iBE6ryegX/SdSo4gDyA5WVRym+y\nau6CniNR4RotutoAFl2RG4IvSt0wdY08RYjap3lksgGkC1mWEf0et+C+EcWz\nfmf3eN9DGzfR64pUDykizG37Pqix77/yV6at6cCE5E4IobsfAcl8Zj/WjZUK\nsePrRPUpuOo7arU7Ac6VOgI0HDgIm6tRcTpfIUZvpHe6gPeUddG8WaVCU3yP\nfCijt7WVLZslxU3Qjk+7Fr7d1YXcw8cPmaIdb6fWxXJxjUEb8FERK5fA26NR\n7GKFmDVEggmxmae9VNIoyqPYDuWV+UETBVtwIyES2RybRm5znnlvlN5oghMh\nfXeiq0yoepEDIyKMPjtK3YLiqDf18Zh4huJ65rCMdvUNt7rHg63DVVc1sQg3\naZmR20duryF1lF9EgKxL96tZba8qDPt1aDs/MdbBt4B3URai6CfLOUg3FDLo\nFdgDPT327GrDpyEr0vfCTsNXW+VIe4E34FV2Z4cWzqtosBp6dRWjiFyKglNS\n+H/KMoCVrp8vmX4OFienJ1rz97HDHUhTKi6pdQds6q+pAbse8np67i06bAjM\nsLiMQhx+uz5vD8zj1V6dIvIoyCYCi3LpdiITJJHjUi6gSnqNWTb0N1p51CAh\nO2hR\r\n=TKAl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICGo2BSXuFyrYovdKItkhXi/cWpvZqN7C/Y7xJX+OzTiAiEAkKBbLRd6sVCQ/UkcMGlpt9Muqy+RU1pzwvpQSe7zsy4="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-bb5223c2ddc753153d69deef8310cf79d48f1f48_1537892823919_0.8309123583042355"},"_hasShrinkwrap":false},"2.6.0-e899b754b7e0bc99964f87e76a20b73ade631d81":{"name":"alfresco-js-api","version":"2.6.0-e899b754b7e0bc99964f87e76a20b73ade631d81","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"e899b754b7e0bc99964f87e76a20b73ade631d81","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-e899b754b7e0bc99964f87e76a20b73ade631d81","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-78wLI27j0ruaxttH9nS6H0oG0LQK7+DZUuNNvlpOGmMlAzPswqrDnCEejTC1DGvXk4DwnLu4/HQ7eEZ+5UxJLg==","shasum":"de1e6fd24ac70318d7f34bed31ca5fc48adf542c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-e899b754b7e0bc99964f87e76a20b73ade631d81.tgz","fileCount":1179,"unpackedSize":7061779,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrf8gCRA9TVsSAnZWagAAaMQP/j9sxnc6KZuURCRyPpsg\n7kTh7tzrZczXmAdamkmPzlIeqHpiXxdklHFWDAkjZbsEOICAiPp16W66orKu\nirSyfpcLNNLGIQlWAAO6gDtY7PH5KJ1CykaSHHoKKMcgihe5U6jVs7PL2CFe\n5l6+gld/ZZRP8xnamiVTDfgcxTsRTaH9DC5j70DD4EF8aIAhDUmdh9mj7p9p\nPfdhzLm0uWQ/saduOFjauQp05yrZ0CsiYUzQ/5zF4lvP1xUINeDZrcKLRReb\ndU6GBoWMnnJobDaeBPEuM997SWlnyR2Ykb5Gcb7HR9PF8E0CP/+yIezDQSb2\nYUM+Rd37YZM8iVWXLDLBQ3l9OgfgME76wJVuJvhEQWgbXjrhNLQRSTUWGgHl\nJAyb9dS+kxG9wKnV179Xdwj6w/jhjIzprCqxZn2mTED+Nf892Gpx3DG4VFJS\nL3KZxNtrIlXz0peXHE6yZKzb3XYYmiI0pNyhXBNhRTYPDmZ560utcvRlggwX\nxTfOYTsdDzrVMIDxvxWHV5QZAxY5qD4EfQc/dWyN5ATlNo3BRn39do9XZ/pR\ngp1imRHX710EUVqG/7Te2+2oGAtz9qvwj/oaJtM1Xcpniob5zE1ukChamXoe\n2a84Y9qqp4URI/32bLfXxnw40btxEo6Ln9hKGnD/P5qxDBHPHi7OaUJq1l3k\nT0pi\r\n=v04I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSRRCUhvZ+9yPegLC2Bfa+0OCJfiCCzX5pRJiy+BYPSAIhAKBdFekm66hzwOYXA9u/PCk2Naelnpnq19wtlYXzwO8v"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-e899b754b7e0bc99964f87e76a20b73ade631d81_1538129695824_0.19550126324073402"},"_hasShrinkwrap":false},"2.6.0-beta7":{"name":"alfresco-js-api","version":"2.6.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"e899b754b7e0bc99964f87e76a20b73ade631d81","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-beta7","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-A221pTLzXrpfIZ6C4ZfGA+4lTv+iznHn4uX0njjunGQ3N1zeBY5VJ33xcRNQddhs+Jbtnq9+bJgpQA7F+Agpag==","shasum":"bf9cc7e0f09afc20d20998e79316c06b6f551eeb","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-beta7.tgz","fileCount":1178,"unpackedSize":7061674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbrjSFCRA9TVsSAnZWagAAUOAQAIsNYsKCdSOEXkOTjdJo\nAxgAOGv31CZAk6L+mUWEs1C7WD1yYs5QJBUyjy6yZQR7/Rkk1aMLfPPhFaWz\n3Rwig8cya77jQZyoNnHcMXmrbLs9zLdf2xBPqCgMAjWticDd2vCxuF8M3nQf\nsJAzPZX4SWruVbDeRvDLm1IPspq30kQRkQ1MSvERV6iSswDYVnN/iyScx/tL\nixfIoy9hRT333QquYUndVrDn7fXzYgiE2b+P0MCGhM88XaptHOblAhKG+x3z\nkUZQDKQJ/9gnY2DT6HDCRUVoPy+W0mHxKa391CHMlpS1q9vPf0SE1ke1wUvk\nstHxLVIUhwljWRqovKgfOkc6/4bexqtRY8OKhTkdFtvF7AXu5EAIir/T0U6L\nrDQRTAyajm5bC7Ycf4QigPSkRE1xg5MhMDbMfeICNFuCaHu8zNWyphaayAoF\nrfMR04AklHOZY2+CsbZ/Y+jBZqs9msFPFnNT3ooNUvMW7P0hra03zI5qJ0YZ\ntOo4O29t+35e0MOMUzmp2B+H7Cw6OrcSqd/5FOfLClGAnxgymw837Feza8fM\nM4x6OWvj3SimDQvd+JqEpkRfTbMVz77wPzG14qgbuUUld4GnxQjN7KxwN6Hp\nsZJlEboiuO7eS3BHz82deAc4UF+lxRsu35x6+gR7rLCYbXzyn3BEEtteCxxZ\nKwoI\r\n=4m8r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDapGdhA/3IVjpoWBD/BugZ1ebdq9E+0+O5IOYnsWbyVQIgGXsclwwKlAHr1DuQEHAbTwppePvrmzAVezACPaR5r94="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-beta7_1538143364639_0.8122446518945099"},"_hasShrinkwrap":false},"2.6.0-a777a19bc169173a712c9c69c3669a98066a482c":{"name":"alfresco-js-api","version":"2.6.0-a777a19bc169173a712c9c69c3669a98066a482c","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"a777a19bc169173a712c9c69c3669a98066a482c","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-a777a19bc169173a712c9c69c3669a98066a482c","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bP5V4N1AoBy0IpKxS3N9WDXFCXHsHhIBlHPvd+ZV7TEbklt3BbuTZKWc2Z1diJFU4SocN11fVs8CPW6IqbtW6A==","shasum":"3282cf9d5bf37ab2eba060141bc11c93b434a35a","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-a777a19bc169173a712c9c69c3669a98066a482c.tgz","fileCount":1179,"unpackedSize":7062116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsg2kCRA9TVsSAnZWagAAfyQP/RYMCAYwNwUd8+fQOAOa\nAhEFdf+jcEH10NGL4Zm04pSo/p+9Q5vnYdtd+JlwKcQdPWbRidjOV4CuC2aa\ndpG0EkOnrhYTM/u54rUJB7k3qzZFNVblVMHzs9qditCH21SgVQG0NiOhFx75\nAwoUMZT4H7xO1dktFZjKMxInQxVLPhKySHnCHXnjle0kezFVui5sk//UjjsW\nnSvFaH4AbqbNeE/qjmpM8PqMdcp7UoZKBerKgeEbHXbhwp2+Kd093Yegb5TZ\nobtgqKTeHAnzlzZefljV55sIE1AcYvAm7gYCKvyNtw9s+v5eI8RmrUa993oO\nrlKUKQ5hL1lZvvnMq3go7qz3i9QaBHnq0wUa1PuEJ8DBBqwbBSDUPRCLUAwL\n7BLJJco5i+uifXB9YTKdczK/cGuR2VUl589k1va3QC4kPeXas4riJZjKd8oo\nW3yiyHmWthGv0ytIlNjQM8lueHsgwFUPGnVLo/MQV5/0Ax2YOuf1m7PudFpV\nPNX6M0gQz96ELDoEfZvRqFucyufarcHYAEQfgWnKropexN8XA0wm2ufzbjSG\nX3H51owt5ZLfV1JpOk7PDQV8tgSv1oi6T51n7rqozkdyCJjt9Flr7mkk50Qv\nRa3GY6K15TwrJcpTISAjVMyni06CDDKZKegy46rD5QcXorpqyNVHeDcu0UMq\nLE0g\r\n=X7tK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBwPTE/m+M5IwiUhs5c8rLs+xCZEcRQxCw+gscF4NliEAiEAxZOXgXrzxLR5xnnwM/hHAwRGceJomdwvh35bIE1X3jY="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-a777a19bc169173a712c9c69c3669a98066a482c_1538395556023_0.3978561697199303"},"_hasShrinkwrap":false},"2.6.0-d3d363c4d25f1148ade6bf21f8b346efd55f4792":{"name":"alfresco-js-api","version":"2.6.0-d3d363c4d25f1148ade6bf21f8b346efd55f4792","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"d3d363c4d25f1148ade6bf21f8b346efd55f4792","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-d3d363c4d25f1148ade6bf21f8b346efd55f4792","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-wVm/te/NW2l9Js1GTJLAhv7HC+IQyrCbXLCUfsFY6GSO8Gyqfx2STSBrJP5GCaLfF6rjQSi0nmp3QANLLxnD0Q==","shasum":"651417f780968745ad745de533ceaf7aa00bdfbe","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-d3d363c4d25f1148ade6bf21f8b346efd55f4792.tgz","fileCount":1179,"unpackedSize":7062116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtj6nCRA9TVsSAnZWagAAuO0P/j0OiS5ZhiGyFC0BfhPI\nK1fr+gXiNfGKnjD9Y/y641W+9KpQxWJjXyxLA8DfhL8prHBJL4L+020GSOwx\nxX3G5YzD66Jkvu/VOQKNyANmNv0JXH+XMVnx/9SlNkcvRaJHY++JuxZ7Hyj+\nIvIxPxZf/TSOGZBHVjy0VHy+Rwg1srA5yO4uBvfOIBoonUq2xQp/sPWSn03Y\n4R+1eXxAYyrb/ASmGbvtavQcAcLp6UsM9+zOaXcOBJgH8wBjzAyVmR8mQR2b\n/LlGjfc29LDb4Jg+aKV7a/M43kcUbWZe7yAtMyjhHPS9N3JB/6iv/TW+eAl9\nGkft32eFrh8ncJoRZQhdYoAlMExD7f0ZUOkBznCxH0KF3dy3GOazN8NWYHaR\nFC6S63ShKUDibrYucTVWXgAt3kbvt08TJHzfVcUp+5K4nVAkbDnxbodDegnk\nPw7lhynWAf1jD0A/U8eU9yUfn46SWtENi8Pp9zici6vCnr0sh2T+w51/GHj7\ntcQsSHrG6ag4S6k4CsOAceNCc0Af0nnfqwZsNaA2kxkgS21LS4hC8KiImY9J\n4d2mAjHqNvYUO+r9GQCaKnKAHqe9sZciOuNmFumHo5/F92zmVwx/n/gM3E7c\nrYHayQzOvqWNTtZA7ThnKsr8nmSch+qZevHXCtGKk41fzKd1eSGFZ7zI2g1D\nd8Y7\r\n=bNF6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDq91WEWAWmdR/fbIzRoiph5+JkNNL3msDqOWVOSERWvgIgFwL42Y22UMLDYFdR7dQQVqLHCNnIBax9t0Hf/uvIiNQ="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-d3d363c4d25f1148ade6bf21f8b346efd55f4792_1538670246564_0.5911978262069897"},"_hasShrinkwrap":false},"2.6.0-ecba2b7165783a3c992a833dea506864c252c5b4":{"name":"alfresco-js-api","version":"2.6.0-ecba2b7165783a3c992a833dea506864c252c5b4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"ecba2b7165783a3c992a833dea506864c252c5b4","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-ecba2b7165783a3c992a833dea506864c252c5b4","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-6Y/6uuh/AfIMJm7uzRY49fTgqaHY52lHB8P5QuzMyK3Gci12s3H3OWhYHwYX0u3mGv7ehX2CyHazcy/wDlw+9g==","shasum":"d8865278c2a83825a0ef9142470b311f7fe66976","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-ecba2b7165783a3c992a833dea506864c252c5b4.tgz","fileCount":1179,"unpackedSize":7062115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtkC+CRA9TVsSAnZWagAAzLMP/A5oIrM3Be4j/2Jazuq+\ncQGun9X/DfaSxEKsyAtKflUvPoDnhh0oEmr6YQv4iUTKFD/KO2fs+n2hUU7t\n4vuoxJLHob/wkl3kKGzWV7qEFQDF3M8PObMpxsuTAppyxOyQ0wS1uglSHt3w\nv9I9tQCmB8lYv5+Y9KJjfbm9sLiHLvrqJFnjXj51ccESVzySMbNmJ0Gc5Na6\nS88MYoyhnTuY13J4ZogxtPdFP1UGCVhb92BDOeaBH6J7vQX+FV5OtZMStHh3\nSFxGDpj6mz3pF01YJIfSA+ywWP77/XPczOi8NCsHHdtWAviym2AsujUstE2I\npBIc3tFbEQUua/SvCqIFfSzsf85KKyMqTV9msw4HTmsE7SG5QG5LkiBisXx5\nJFd7pL6AuMGDgu+odKfrzqdYLvHDwexj/SWKFBGuAuqizntCicjT3w+qolcD\nzRCTLCTAIn5wbFrE4C2vpF/FJhTIxqc8t4DmDdJ3Mm7nTBAd+j52ds1HAYAm\nQgtdM6XJjWf9PVKDGdI3KYNyThK7H9SF8s6Ow6LiehKu0bakPX9E+qQkZvTp\njjC6Yeu2QPN4MX8nTwQ4tOn2wH/4u5tMUVIDkiEAdvUBResWhl183S4vBdr2\nsD6kOpE7XUSqNx2E9MH4wj1Js3fILeawaIH1ftHQSLdtX5xgQqZNG8nB1f6u\nF0AH\r\n=IRAN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAa+ltPQwgXJqqKwWSKLXEyPtEnFa3jalV0mt4XA5TiAiEA+z/xl2ojRiVMlT36/uEjV5Xh/9LutdyWsE53ZLCs58I="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-ecba2b7165783a3c992a833dea506864c252c5b4_1538670781734_0.2078048209405663"},"_hasShrinkwrap":false},"2.6.0-3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef":{"name":"alfresco-js-api","version":"2.6.0-3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0-3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-hiTNP3k090CRrbbULGYLDSidPQYilQCK4qb0+tIguRYiY4s639f4lnyGZIkKF7s7ddlB54WcG7uok4xEpU0Y1g==","shasum":"cf717f69d42b4ce575ed346c02cb056c554b3dbe","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef.tgz","fileCount":1179,"unpackedSize":7062116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtkFtCRA9TVsSAnZWagAAnRQP/0wREooWayAR96JYMm0I\nFSe4X8cXoq5TiBGcgUOJeAwa+++EpYf4Pqnz4hBf7tDrHc7Eaetl8HInw7sn\noHmHScQbu0CXgfq+hgBJRNRGJK+1kNtc1eayr6uEvT+5FBdGJ3Fa++rGqVYU\n/bkPjQ/SfHDHLH8mu8WFsjxcBEpcEdolXIe0cLWODXt2MMtYi2BGf7Fu0ZSf\nvmOFixrR22YYxDZVZgt5b0hmo7qrG1lIzRltOh20QQUZbzu40gybAw4btIaC\nwEhnTS4x93Qt/pWjnuGHFGCFZLygM70HsZlCKiFptInlwKXXqB524/4ZfZjb\nX01mk9EnVfpGU7xp61dram+2vI7uaZAI4b+dF6zfxdZzR1IB3zRzakK6AYgV\nlk7WkZh6sKjtaL+RrbrivpIZ0t2P7iVb0OU5sxzo/Wvp2sgpb2a1amkMuT5j\nbPWicBA6qUDVCkxIQAj+IfrvkshX47mnp/ZpgoAvYdZOYbMQ5M4sCU1P5Shz\n/0ixH2EQ3bF86xTog2UJpqu8iKeLSiglKE7msQj+SItpoCQXkHkvPwrE1ZlB\nDj/Y/8huZ2lFRrD9XxaOCnZ+ofhxXEM6y1dhBayqsN7YsSpTuDxB2ayMzPZZ\nSAtTfXOODdNTs/wsa6SF3mIm2kJLIZ1k5v/kFaqyKO6FwoeWbOnWQq6u4DvP\nXWy1\r\n=UYr2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbrGUO4aoR1KG6daLYweRIWgoJD6eQziICB0U7zU2AyAIhAJd6IeTcwcuVrmuwW7S/SFi54fiivU3YU+/gTfHm0xWS"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0-3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef_1538670956351_0.6294899337935937"},"_hasShrinkwrap":false},"2.6.0":{"name":"alfresco-js-api","version":"2.6.0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0f0b0351f0c3f823b3dd148c3ca5e317213dea48","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-ua+RBHViTeWiFoL3ncPO68GVHsUUQth8LxutuxvGA0Sbino1oJi/CcSiHjIungSI8G23Im9X7e0x6FP9XcuTdA==","shasum":"385847fe9d40ee3461cff06e87f4d2cd009ebe28","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0.tgz","fileCount":1178,"unpackedSize":7062005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbtlxTCRA9TVsSAnZWagAA9U4P/0KLOCTXYoYlBXTn9Yf+\nRQmhn/lCuQfz+YOHj3ArQ324BcsZ0ttX3Mj/mSSL9yj5nU//BlvYqkIwivAg\nZQaiHsPKZ+1T0HKhZp+POcPpD0cV9xQq1Q6gKrgroXDL1quCBopv96jDbbap\nfmB/OTkomj7FKxcCo+PFmMGiOATHBsNPv/EPALFIC3DStFz+oT28kQfRhrO4\nZVBbmE4KXmhsvh9rLOnHQXTZ4o69vsHf0s0pfdAoMkzSmHrqxWT/K4C+fmy1\nJSt+N0g46r17FsUiJa6S8PcswGF6mDuMudXsUuE6pzg7CVriPokjqxCPoP1D\n2hYrWJUHACcLVTj3GkmPn1nQXIr4yT6IZX8tEHBXZ/M1EZqTf1ySheiO2Oc5\nRK9tY8DWu9Tfz9tulZTTPkzVpLVkToh+5CC/wNi0otmR1pUYhkylOxyX4iD9\n5fWpEiaMOTejNeM2Poznwvrm5cKShqqaMqHcOJc5SvD99ZiiOEgqINPgewcU\niPbfSL1Srq6tQY/5TcBgmUwws7UxTgAqVhHZ5R0pw4xG9OTphm61S63SreRi\nh6xm81288gxr84CiqkwkgvB0KgwZxjeQSxk/+VUeXwgCKBD6fTaP3e375Eui\n3JPffmn5h0shPacwhreGs6tMayFyKlBWkzG2Zi827aX1WTOUI3xd15SXZRCN\nyUXj\r\n=pL82\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGD309e/qF1x/MOVzh/LRlFoPlfvoC8zAoeeC70gRt0tAiARR4IcPqJ6qQoYVEttRUCQYbubbIC6EYdMr1HSTN0b/A=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.0_1538677842794_0.8391538484964987"},"_hasShrinkwrap":false},"2.7.0-beta1":{"name":"alfresco-js-api","version":"2.7.0-beta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-beta1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-sMtwQmz2CiAYq9odvLlBpPUHTBEEnlU3WMSa3YWr+TYgC2ertWh8CqKsQhr2QYp1mktYWTYxlPI2o9mQJ5L1ug==","shasum":"ffc6d25c31ea573834f407e9bfbe075ed3e3a9b2","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-beta1.tgz","fileCount":1178,"unpackedSize":7062011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbt28RCRA9TVsSAnZWagAACBIQAJaIaxGBpg4Pyrm2G5/8\neXmMb0ulaWQi8i0ynMyB4ACZapac65RTzUG5b7cDUcFvX4ysSgXBq/OVFCZt\nsYdGAQzWtcZe/7dVHbBwKUqpxiKrcpQuHKLHp8bbsz94wsgDfWXHGNIQsuqT\nEg7nE+r0sEb/53DNjNv07gvHG4iTk9JknIX94Pg/a9B048WUe8Jzs/OTtJbB\nZSCS+mhhcensJp3US6EPg4pUEQb14yd2jI3dmZlmJ83byX7P5z+EOxetPOmQ\n36i0VMNPGv0uGFoGSy8kSbxZicPxlQ/OIs9rBazBamC1WvFvRZMff4yr8ii8\nFa1XgE8/cgARFiTrOLs2CeOh79CgajWb/ToDFDIBsuXdKQljf17BL3ZPHx+T\nmM44o6PbBh+HLtw6tdWBSf1dKFdK12lFLvUpC4RExGiIgMpQoBPBNmXj/fQY\nVsVgrTYVx4VPvrAxmUqfgDh2VxpC6XGlR/baq6z+ybWR8vURLEenCXYO9Txv\nIm7s5ScezTyaXoDBC3H5siEgALz98FpBIKX/agyrS9BDrdzZ0UFBpfuRv6pI\nMk62ereU6/qR+/LLQXkrhnM/vBj9jLMYyDZI7X+9xS7ycAPYvyAC+gRqTKNE\nUnp80SqqhpeBvSEGxt99aTYCs3b3+QNYppS27RF+Uz2DqiKS8FFT1zVUVx3B\ndda+\r\n=nQeO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE59aRvc3Z23y2PoLJkUr1wCoKNgl+9AKSUUEgXbGrxYAiEAq6kEpKC5SFL5k1i+JFd4muXrXtS9RhvoL8m1m1EpKLI="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-beta1_1538748177041_0.056217780648958326"},"_hasShrinkwrap":false},"2.7.0-beta2":{"name":"alfresco-js-api","version":"2.7.0-beta2","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-beta2","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-imwfMmLTjvk++HYFwx8p1ucgwPMJ7WVi2U3XX+WietQTGyyFeeTU6uC8GcfhBxEoj5Fund3eNtEvEhKC/qZ2cQ==","shasum":"9e772dc54c4b6337991b8a5ced9ef30d5b930544","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-beta2.tgz","fileCount":1178,"unpackedSize":7062011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwKmSCRA9TVsSAnZWagAAdLMP/0yEvfvptVX1g5owqxrT\nAu3VQqR0maYvHKH8Uwyg7b51ghRRSsNafur9krBFPDz01P9o7dq5oFpYvjrq\n2zq5cn7iRE//wpiP0eazLyINduen4fVTjv/Syv6aCVPa4Pe7MNFT45PH+/6p\nc6A7IEMzRMPJ2YtXCRG44JMttfMylrk9dvXKWc2xnbEu5ruFZmpLLSPlGHZn\nd5S37h/PLnAWQm5leMIII05j4RHtBxPh8T29Vy8qjJJgxNngEnd33W42i3HF\nc68X9xE1fIFuD0u8R8lQcFu1IPMoczT5ZvrTv9gP6/RtbCQXgGp+fg5YbRYC\nhAU3zayi+dTDbO/aLmKMvo64mwyKRfPZsfyPuyu/4XOJgqEocfqD/WtWF5Oc\n+4cXxa3miU/c5G0JJ1wn8fhHi2KBAre1zrGnLDvGtsqkAXorOkxakWVpdryf\nJLOFMGQhBjtlZ5XDCngSuNRTR7lDvtKFBmOTRuvssbqir+Gwx+4zfmdUioMT\n6OajyyfQwlXWBVk+i6D6hBv/kFmBVIpbsqVonNd+4xLCOvzu5rtnvbfnsdTb\nLN6t3s1wbuWYs/DYndCVxvJhbf0yGb3yqg3M7ymjf3IquSAx6c6vzFLQ8YTn\n7zdAH/WUvuZe8op9fnKbHqf5zr6RGP0reA6PQ7ogf8xTwR1wrqsFNfz5kJxl\nuVuG\r\n=kMAK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFtSKNWLxYE5f+Tv7zb9BPNJG3XrMuZfFpdzzqqm7q1dAiB1NHdMMoihmo25le3nLaWalZ1Yt7Os51i590XYMSv8Sw=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-beta2_1539352977296_0.15862151926079515"},"_hasShrinkwrap":false},"2.7.0-6d1e61de7e274a14eda3fcd30efe30396889b3b0":{"name":"alfresco-js-api","version":"2.7.0-6d1e61de7e274a14eda3fcd30efe30396889b3b0","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6d1e61de7e274a14eda3fcd30efe30396889b3b0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-6d1e61de7e274a14eda3fcd30efe30396889b3b0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-xGB2oQ0BpY/57g7hXeMNQz4LmOvqMwZlDBsJs5A9CjjfZNeNKzA8ICpsQ1fSf506zA8Ex8doPdV3xEJ7JfecZA==","shasum":"ba9285621129aba98fafdf64ea8968a53eeb4728","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-6d1e61de7e274a14eda3fcd30efe30396889b3b0.tgz","fileCount":1179,"unpackedSize":7065155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxxYwCRA9TVsSAnZWagAAz6oQAI4Co0FsWh+2G2w1OHhO\ns44rntdzhsmUFTKenC4woIUseoLRjaGKmX/UmHS2gkiLUaB1w3VDuQzmnvuf\nyjfZpHh5fMCyRoJADY5oMirZzZWGqKl90w9NWLA91UysGXYFuMoKXjW+p5F7\nKNi68E3uwvXnLd0sU/j6JEP12iCS70bEWwYk0o7RvETxqZmw4ZVFTX2h2iM6\nubu4Y4g3tOa7VBwpr5WN3sQfXK9EQrBziCa7jBXOp2l+Yhg0Dq2FbcXp6mHC\nftL5ddLxZNmue0Cnd+68eNeng/TQSHg391+D7Da5lafOyGs20xDoqYaswkeu\nfPHGs0VKN59szLZnnvxagem6zg7VQw+xHXwX8EwVdU0PO2bU6u/UboJJcUDY\nFqRN0eiO1W1EJ0N9wVQmDKozXAO6LRqp9sfuPnN+n9tjJKEgwcVaUjT8ZDaW\nqwQa7YAfCGRuT//UD61g4MZwNlCgwjgCTomYovhWCW01TzX++1NYeoxCfoyq\n7tyUKZfrNjQ+mDvew2dnMyhH9RmrGxc1vK1Vio/POwWJ4+XkRYk1LGTmYCrf\nzfE8XdwP8c7Bg68pTU874lZf7DgM2Xup0NSbt3jxv7N89jCLua2V+f0W2f1z\ndDDNgOGO5p4hTCXIUjNiQmj0IW6urBYm+m1/QIFt8eoM1gI8XHS9IU7soR7Z\nD1jN\r\n=jtJT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHxJRy8vaPKBt9oASoGxc/hhFZTWGYLm2FMYwMH5girwIgU7g6a3dHvG9Y6GYJ525c34yDlqSsCq5b/cg4+LXhiUQ="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-6d1e61de7e274a14eda3fcd30efe30396889b3b0_1539773999273_0.8084371672669761"},"_hasShrinkwrap":false},"2.7.0-beta3":{"name":"alfresco-js-api","version":"2.7.0-beta3","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6d1e61de7e274a14eda3fcd30efe30396889b3b0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-beta3","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-AdcDnjzgMA8FS97jFHq/wdwkw++LlIcmFIUrdYmMobAB4vlMjWJ2RwmIZYASDqjj1HRpwtYwxp6n9gKNixHbTw==","shasum":"abb8109c281c3143d3d6b4d175f1bcd073e42239","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-beta3.tgz","fileCount":1178,"unpackedSize":7065050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyeQPCRA9TVsSAnZWagAA+VkQAIIhmn/Zjk9bIHiTqHKZ\nue0g+A/aJXRimzkQvgPYfsETDDJC0FL0KVeLQ2HCcT713EDmGhpgjHC2jiOT\nJ3Gz4/alIrFStTcaqOSH9tk5zH4GJ22Q3BZaNNzx9+MDCns0MX1UrfCEHteb\nhZ4wNnUEIQdYTq6OvnqagtJkrwx9mQUWOGNxa0FPtw5gIAl4ZaAE0Xe9gdAZ\njzKhPBGRHyRA9BytX4oEI3VYIQTk/5vNthPhCB1ixDsBhnxg1Wp7UcTWVvzB\noU/0pmZdAbWRnAcNjAb7hCOZbZ7/hKe3RT7HgutNsFzQ+c/nq1eWe96iPFFA\nvEUkE874OjPsj1uDKF3WRY9/PcXc5WIP9tpWD7nOBl4ve/lKkqWt7Q2a+XXj\nSCdlrG6MgYYIegD/fw9xMVyj/7vnjap2e3EARJFGOuL1UUadkHduCK/rCd/V\n92rFEVI48gzWo6WGKsNhsPnGCuchGjkKEIoDTdAL36PDXQ77F+m5pKVmeprq\nJ03fTdepP/Mp4LXjIU6othThaM6zojC/DEjUi208/oZyHe8Z1PvtjDImKCI4\nwVDhjGZoqygCQv5zKGLLn9tktRwub39QVmJ+fC8YWwmTuR1WxxU56b7MaXxj\nDyITq0lUV0lgqbQ6hXukQ3G2MY04aMcd06tVa2YGURI2fBGtODJnJPAS/iyQ\n/HZa\r\n=3wWb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv/dN/BdChq07jPcyEFtYDnzmsR1MIKf26FVFYhIt4HgIgQNysgFqzDoRaID/3IGKVQtkvKdoOA+GwhaSfykPB4ts="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-beta3_1539957774321_0.07857472278269584"},"_hasShrinkwrap":false},"2.7.0-beta4":{"name":"alfresco-js-api","version":"2.7.0-beta4","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"6d1e61de7e274a14eda3fcd30efe30396889b3b0","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-beta4","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-KuC5i6uspDyqyrZrxP4k+kRY1a//6ndgm/8O3bHv6A/V07tjcfvVryjBNJqaaczCja24nQh8GPYGGeOjDp4BhQ==","shasum":"c9db0f92c5a7593374beaf88c37f8844a0d06f16","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-beta4.tgz","fileCount":1178,"unpackedSize":7065050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb0x6TCRA9TVsSAnZWagAArrIP/1yssKp8RkZxv1McfkZU\noBXc+s7s4FTCnH7XsF1MFs1mUkv1m0FeC03f795SVNxSnml+qmlY37h4F3Dw\nYKDeJmnfHppAXlWmOC3ru2HhND3MNDHMLmOlixej0Vo88og1B4IIL75DdxGu\n2tG6vHJu5HpF7mgsB+Dg2j7jrtKuj/2YRI93PSwc/YDZRrlDe5hMyEdonmTw\nXQZunZQnCdIxMTIImWH+7vrkvqfVfbFeHcEFJn8hiPoQK/ZpQHenCZBSBJhk\n8Flpk7y0k7oI1rz4cds1lCkmfBez8zMozFBD0pfp0OQafRPzFHzO9uitMBEX\nHWPN5OqW5i0QnCqsR8SVh0MWdaoPmwuFrQ6G8BOyf44tY3CWSTaZjT1Mt4Yn\nyTf+5SNGeJixnvp+yYgiWY1/h7ZAuTsK59nNgeFQAs2/jCzXFdnk89pLRYmO\njf+OrEFYqr4wuMCgk/vpi/4RRcmm/ZwhKX0RNMNGzQxQjp/zVKAVTEKnMuIU\ndUKNDsJhVAgl9QR8VRAxXStJIAOX5MeMWSxLdKXLiQKG4Dq4FggNFbrL/9iT\nvFSHRzxOJh71I2FPr1F8ct74gaREUqVvEDgwMohK7VC5Og1DTlM7N9kEVb1F\nYK+aBP0BkX/K7RKaPGvBd2SnnKP90qkMOk9v9LD7ZjHowova07xckxFit7P+\nopXY\r\n=sYAv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErk3DYa2PzNLOlz4fc4OySwhNe7rp7YlLV80NKr/1bVAiEAqDsxiBVVxwvs/E71G4FCoWPvteBLKgJZA9cXO3q/e+c="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-beta4_1540562579206_0.15178001348832537"},"_hasShrinkwrap":false},"2.7.0-2a84d662e8134ada8923742adad17351a4a2f777":{"name":"alfresco-js-api","version":"2.7.0-2a84d662e8134ada8923742adad17351a4a2f777","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\nwithCredentials| (Optional configuration for SSO, requires CORS on ECM) |false\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2a84d662e8134ada8923742adad17351a4a2f777","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-2a84d662e8134ada8923742adad17351a4a2f777","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-WMi3sgjLVRX1hzdhLqd/6MqLlIKNPvaKpxGgR/xOjVoRArBDKN1xUlfXKaOaMIOF1guJ/x0yG6zTPN2X2z/Bow==","shasum":"635b3a01095b82084d5ec35cf6d53ff0c3f36d62","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-2a84d662e8134ada8923742adad17351a4a2f777.tgz","fileCount":1179,"unpackedSize":7066542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1zbuCRA9TVsSAnZWagAApcQP/jDlJMjIAbXkcIgVnZac\nCPnBn77mS0Sx5wNFrnI8EAS1I335Gntfc6K3+j91z/bHSvDbwHtqGWi6qMCE\nP7gqIAoUmByMcsV2Vhm+qaLZknO1Q7p4rPx2MkyusiJjRxU7pqP4Ea9jt1lx\nEzzjCZ9nqJSZ0TvmGpbdpUc5gNC578o0YY4mBGwXHGrAtQAMjDI6re6xatkN\n5bPMqoZywg64mjKDy86ONy6YyE+tmZ8qKy/hSV5uKS0V/k4B/iCAeOqz/zrA\ngw4DMkJWjDu3iyg/Kh0DssRJ0YSCwf08pFcBAk2AjGpqZMXCmAECK+O2oMYq\nRdddQe99bLyBXqyhtc3PBFRy6edeBJmDjN0tf8U/OIZIYqoloiOMaL1VIGoN\nYfhy+EDVHsTL3WR2L05yLOpXnfVh1t1C7xeHW/wwKhc1iX3axPvrGElQ0CXs\nvqNgpux7/ioOoVu+zW6M7/i7W/bPSMc9MPoMSnVzWxTgw5o3wkGjJNxUcUzt\nyt417ONklYsJ/YEyfOn14Uq8yyE6WPiHVMd4uf21xiZQcO9ET1u7Dt/TkwFK\nqk9/2uYhAogZ/j/kmi1b0i8ngbuqk4ZgusEI340pK28QUcgKp28nFmPpkIQ7\nM4xCgILZRP1a1vEtBwrm7spwJy/rrTYJMIrY43Gnbx2figH+U9V+DPrmoZvB\nEBds\r\n=KfEk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDrI9BOKyC8hj7AZC1W4bbP7Nf0bRsUj19MxeptyTvUvAiEA57DASNiqswYtCdr54jAFBpwUcIz2R/zHp8MFDsDff3I="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-2a84d662e8134ada8923742adad17351a4a2f777_1540830957733_0.7253407031808106"},"_hasShrinkwrap":false},"2.7.0-beta5":{"name":"alfresco-js-api","version":"2.7.0-beta5","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\nwithCredentials| (Optional configuration for SSO, requires CORS on ECM) |false\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2a84d662e8134ada8923742adad17351a4a2f777","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-beta5","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-y/DkrfanNq/kR7nBSqA+dTu7YsVmCl/calvqZUWlmUPlVWMAqzmnteFt2FBZivlo6FYVAZbVWqAaSkvKqEQSFg==","shasum":"a51f6c28b0b9ecb2c3015329b38953f85d6d6bd4","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-beta5.tgz","fileCount":1178,"unpackedSize":7066437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb3GjQCRA9TVsSAnZWagAASjwP/0rK/cU7HTXKN5Wp3zuU\nXxy1idZ4FnlzQg+Vpx0xkvPiCK2htB7JXvY4Xitwet9Sy63whsJvfuSP9QIO\nPru3eh6Ut8LRCnJZ6i79e81fUanADMOibYVD2zEYGudmeU//hjCUi563e+YM\nZw5j6J07/9HiAXGOcREUIfA8dA+r6nOwjBfnAwp5H24O3oRGoj7pe/NK3dWq\n1768E81HK5f8bUtHxOz80Dxpkav1uXcIWgAz2k8FJ0QvYpKwaYd559sRHv8g\noPFMVEy3VobRPTUisnWxJ+lllzslAfUYFYalCwYliWGqKsJUcQL7bwsg7QyU\nkKUYdCkMuUwfKyJnWZf5Nl0dp+ufFSP3sFxXCOLdlI3LITqEuxK/n1lHPT9L\nMkpZRJZ8WwXZnHVx5UphOtZMmVT4UXBygLhDbk+UfQypWnyC1TmGvuxmt+0+\nklUyz8vkmDyAQzpSFak0gNwhuTL0YSN4eHF+HGjIIIfyfzo7D7+dXRZOxDr2\neYsafkw24yH6My5bIpGVaFE9F/LaQJTNZfOX209P+dcOKd+QccsWhAgPT4bR\nk3cSFg82tBTmT+U5EVZCPHfPFoFVqKmbsjl2aJg8DiBVEJCFvr3TmSsCNU3s\nDsGXY/BUMNmjrL/38vRMEW+6Qo9j0ciV+eZhJOK4RbGl+FW+1KRVeCA/rw54\nzbi/\r\n=datK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClgXLCzararIAm6FZllb+I0IlpINznKjeXEiA0d79qGQIhAM4Qztxc3dxWKdvcG9cRxlN7GHmMGoNo2jWODYwwn62L"}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-beta5_1541171407805_0.2765828398512935"},"_hasShrinkwrap":false},"2.6.1":{"name":"alfresco-js-api","version":"2.6.1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"0453a4156964117f32ef0d2fcc319d4e5fda9a0d","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.6.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-E1maHlxlFS3DAmYWG9ueerMWgrcbJSVFO52Bfk2XGx3atEnH3iBFuG0ZczfCJCGIbtv22VliR5qQ90Cufuzhkw==","shasum":"aad15a684589f48b49d1955ef17c95544cd07f59","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.1.tgz","fileCount":1178,"unpackedSize":7062215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4dfICRA9TVsSAnZWagAAh1kP/igsu2868pbGYOXoEsEV\nJaryEdew3NVRWJnQG3Lx0INc3QXgZIld6zJiyCneiJT+W+DFstBbzPukZE6P\nfSlmjy6xOsjUI0CRjWN+zCENTO1D6IcCxlSafNdTed/7OMYWeky9Qs3Mx4m2\nD3+m4Qt6SdS2ZnSsiHPu8doOHCXseMAnVTM6CzLztX5cgI6X3jyZ2k/TYgng\nMM7uAls3xj8gtiGFTyrUEPkX7mJ2La0Dh55rwtosqqMrw3MBwVmblTtR1qrI\nmWnl5fedVLofEyamLzTI/fMAG6dEv7cMfsvoAREOMv6qV/xAV7ThLQmG4T6J\nq/hgwN+WhA35MRIwmh3pdtooKINoMjHTDIqdo6Tmvq4/utFyMANb9p4/m2DU\nr+6Hv3IHtaG/p3O2Ip6QYW7V94qNmKdw1rr6XhCdeKvNrise+mVn9kbL3rdY\nlBkmcKEp2YcLPx8fpohmyM6iRfYfFXsCCSpJ74WJbToiXJAV68m99+McjvFd\nMbJkM3zlm2UEk838GWK9F03mppGBUjsVI/OkWtvL805XEStt46dt6jRxfuhN\nyB7MTeSCUqoVMFtO8Q1yl0DDHbdRI1Gpgi0nr4MjiN+Mc5wahsXNmSpkH88X\n6v4TmA/RVXkwCisdr1xcFmKCiBxAID2zqO0nCOi4fKILushG6E9VoqGYDFul\nuPnn\r\n=/zwJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDA1wuiewBr8Sm5OPD6q4DxrV6boDIzbMBVDVJ9DtdWUAiA78vmEyL9dycQkJCbjicNo01mkyhgyfJepX85QUZYaIg=="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.6.1_1541527495536_0.27223686886553233"},"_hasShrinkwrap":false},"2.7.0-beta6":{"name":"alfresco-js-api","version":"2.7.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\nwithCredentials| (Optional configuration for SSO, requires CORS on ECM) |false\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2a84d662e8134ada8923742adad17351a4a2f777","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-beta6","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-bHT3Pkv4uB71pGNueLIcxHMKWfRCT4tpcUvjXCDXFbptS1hzxePOp8crXcqjGB4HqLsIidZExrlhX82dpfasBQ==","shasum":"6f958774b794e01b226019243056d711acdead07","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-beta6.tgz","fileCount":1178,"unpackedSize":7066437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb5aGRCRA9TVsSAnZWagAAlhcP/0NguUWKuuDPfLrVVfoK\nlEPFkgjoP7RuZZchgAHNbz/Nx0ukSe/7+4s3muPaclLSWOQ8MFdfHXUvki+T\nvyX/DxWItORieBQICTCjX+XG1lDemmYyQf1uP9a6G4g/YpF/Xbc5XcbwPXX3\nhtSXtoXm5mNSgugusfu9CEnnoxkgnIAwPPwQrcOEBMG/VAwTsQc0JJIUIVGr\nqtNK6iykT4Bmzmq/BSDpfvJsZDFrHPYhEA8D5ajSXdKYAOhjmr4YPhBbvZR0\nMDIT/Jnm6ePOGCpTNSykP3EAKXUOsMx1SvR9qLiFXOW/LtgPQPfNvy6sFbst\ny7ANlJAVoV6z/ZKh7nwxYGNyEYsDmVFOLg03lqDnb+POfCkaQGaBLEVAKFnj\nassjg67bYbq450MX14+DeduaqJaYluoK59LPc2N/N6xz1Zh/KqrpfM20L4so\nwObgWhVmKffuOJdQA7A6PXaRsCGpEHjW0XnoUMLQ+MXQ5Or/+6F7qOVPUi89\nz2ncNCbTxXGn63eesqWPCXr1vzz0qAyjm7jzX579L2B8/uRn+drgo+eaqndT\nxwXVupAUUwPH7dVZ/aanA7jeAOAU3A3H9EgiYcEj8MZJho43fbhEQbD20z0I\n9ZLwE/Ab+D03iQ9u3Gzjn8AfftWcSaP/jwjZJMV76LAywfCa6P1uwY6xaezG\ntVRx\r\n=XdzA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgFZElvGwOdUwwZ4UAxM2Y77W9RbY9PBojIz49yR9eVQIgapbGxtzPebUiE6fHSi2yCg050D0PKDemtmf1JXqKwOs="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-beta6_1541775760226_0.07992285573857827"},"_hasShrinkwrap":false},"2.7.0-beta7":{"name":"alfresco-js-api","version":"2.7.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\nwithCredentials| (Optional configuration for SSO, requires CORS on ECM) |false\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2a84d662e8134ada8923742adad17351a4a2f777","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@2.7.0-beta7","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-1djFHLro7JE8PcopoZFf6Pqhwlh0e7vK0HGF+iLTitWzI370bPLAoTezrq+Ham5nvuZAFEHk3+9wy3Qv2WRjiQ==","shasum":"f28ffc5908bc410cccea770a20bc6a0ee029e88b","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.7.0-beta7.tgz","fileCount":1178,"unpackedSize":7066437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7twQCRA9TVsSAnZWagAAhrMP/1EUWFn8n4WbD0q58rx/\nIzt31HyJu4oJ2KNQDPRIfzpmLRN+bAmJB+XUzwcyT136phzJVrO+l+NDyswp\nN9mQTiUqyWpt7lSaacK7HyTV65G6mrFeEqiaDK2qRl6kqG5LeQT/5XkRtlU3\naVmiNBL7Rv71UNXxYBC3d0728AdJg9ge5B/GIITtPtsO3Dau0Xc56uELzNLl\nY77Fp0vNSo0gwQyQQdUk9/wj38Yz2TDw8n/qS9Y7JgBh5enAyf/bJxw/BBpM\nQUvUU4nIJkfXLpJsjdbGVcbKF1mKrVMXHSwvWn/N9HwmzhlULOt94kjx4o6b\nATs6OEYF90ibsxnQl3bvE3M46VyYM4Hga1SAV00nZshgau+Mj9jsN6GwP2O7\nkyNn1I0fyJF7/DbV+jiiHnQuCyJpW/6EwhMM1E228JyniFWULSDodLyHsFre\nuaAVvTyzMdh2hu55xgpCU1JWBrerq3Jq53vYbcWuMWqIRrHaKNOHwYHvHslr\nno7xmqrbR2EhV68HCFfoaS4cg9ZfmYNrM5wZwXlziYu6y6SpYsBqeIfSZViZ\n+7mTeFHJvx4wM6gb1YspsAQ6aBP/NVIEviPz1fDkyNJAlTyI79U086SKNASo\nEhmVYddxHSL8iU5ddQbbhF9W0BXhyab70a/n/ySG8z32Pg7QWhDRtkZFOqh8\n1w6E\r\n=O9Vk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwqHRk7xDUjCR3GGGORdGIUYxvnHUCko68nWdZFPoy5wIgdcN7jYcClBXo3oYg+DhQIbM1LKam/rFXHVi+OQaeKEg="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_2.7.0-beta7_1542380559600_0.10379594857422503"},"_hasShrinkwrap":false},"3.0.0-beta6":{"name":"alfresco-js-api","version":"3.0.0-beta6","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\nwithCredentials| (Optional configuration for SSO, requires CORS on ECM) |false\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2a84d662e8134ada8923742adad17351a4a2f777","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-beta6","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-VADSYFmF+5d9tBRN6ZCEDOp2I29LdTI0AqDpKEoukcnwABsQUqUusGOA9tAi7QkGgHq2yDFV5OGTMxVdeeqRVw==","shasum":"0f969ac63fb94c425500e0171f7d6ca82da1d8eb","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-beta6.tgz","fileCount":1178,"unpackedSize":7066437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8uzICRA9TVsSAnZWagAAet4P/AzPTxC7skrco7UJW1NC\nFKMIIJNqaTtEGVmq3wq9TzQo3mkrriNuaDUeYX271e3Qou8+RGW4GdlDWsKZ\nkY2Nf8kGDrbQg7rR+g3bi9NwOwrUJLXB428RzJvEFNls4J0pnrs5cBQUI3Hv\nOqfgxhtDHlOuDgNqRbpqe7EkOc5gotNoUcRx/6Y2eZRE0QV4chA7bZAQ2Y9p\n+I231O8ZmXBz+qBsKEeKEJRTkpazTQDzGo+lwOXb0lCfftV23m0WyIneFGbA\nRx2oXHrq+pNipNbh9fbT0zYMeuvp/9EliGr49i0h1zaSDffeW+KIYQ0LeZbx\n+JNIMtKqGE1GjU0xwdKWRrkj0mIO9u10TLgy4KcKm1KPWR6445uimgx2/FyI\nG4SoJRoABqD754aFoB42blv3Pl/8NQ/PKPitL1t02pxwQPz46OK2pGGeIfod\nINWWkNvBLHnxMYDaotyHtcx8lcIKSInZhVxw0ahYcI6JVeuM0OrlvJ1DkkKD\nyvpDLvIru3gmwlJq6Z+hjQ+3JOPH5enFOB+kvVGYklDNV4v/Rc2vGG1npvwZ\nb2zygGSwaGS+STPmu2W6W6sthuZbEu7y7ti2t+pd79/HyX49+ms9RV0TKzIc\nUimKHgfN8Po8GYDhLEu/+jGO8h+h4t1mjxAeLTSAlQ2o7RV8PJsx13Np9fyt\nwBd9\r\n=1w4C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1uDH6YX9RBGktWuAaEwNlA6TueoDNbRsvZwIJallKRwIgR15WeQTeANpahLqfC5MzbJnDPigJuXD5JB4LLRlUnQ4="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_3.0.0-beta6_1542646983405_0.12536067683149144"},"_hasShrinkwrap":false},"3.0.0-beta7":{"name":"alfresco-js-api","version":"3.0.0-beta7","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\nwithCredentials| (Optional configuration for SSO, requires CORS on ECM) |false\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.bpmClient\n-  this.alfrescoJsApi.ecmClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","gitHead":"2a84d662e8134ada8923742adad17351a4a2f777","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-beta7","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-gpIi2+zcSkkrccRJDxqFP0HrO525GdylGr3elLysmUQH1NMROWMGjbpcZbmQEsWR0eIunQPPxbvYq2lzwgomog==","shasum":"ec67880cc1886d981a17f5f3c737d44b70fbba2c","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-beta7.tgz","fileCount":1178,"unpackedSize":7066437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+BaVCRA9TVsSAnZWagAAGmcP/ite/pRjVKZS7mSq+heK\nDi060+2God7sN/tqwjIwDk5wVCI1JvhNM3kA3p6pKegnM9Z5aqdJU1suNDb1\nkpdjjUDaVSneSpG3rn+EYDxQQQnvH4Ca18aOi5G0JqDV9900B/XgvmkFJ5TA\nmfDD/oIDy6VxojrlBhImef0vsoB2GvoE8QZC1rMXaWuJXEQw53S1WqrqZptO\nTaygtQYOAla8vhNcnwuX5GRxoVmfknssgh8k7C8HS2Qp+SoN3seyWpZK7p/7\nTh22YAoePzy1RrY8JMUlv1MkrnQbRgR6wmzQ3ZpgzgTwjQmaNfbX03UdQXvO\nfH+m2jzRSKwOthJ6BaE8lH1G7xm5m6jQqrdKyLRVMeZPqg84CsBHvtO1k47p\nP8NmwlS0uMuRriIGOe34ZKQAuJ/0F82/92jDFcLvbOndS8xMNMw1H8pB8+4J\n5zKk5eEUowX00kaux/wTaIgymKsT69ZH8y09XHe61LNiLAkEp/fcuU4F/eLJ\nnLP0dluuFnZFNnTFRFqHhQQMlXkVRVJxi7XxSqHdMfGPA/8MHPcHnAuAIw50\nDJyF0aFw9hpwCjfTUlNVKcmQRQxHVYpBkPrtk9DeUafz9AVuzLDocoUUs3qT\n/V/Jf0zMdQ9VlAtj1JUCL5JbVSuBqena1E2oTZvnPNHiWD8pp18cZGRydmkH\nujS/\r\n=XwZl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE73rdblxmwgpbdMgc69Xdnlm9wex/gKGUauDZR0+6qgAiEAqQa74YaM9UR030zBUkXWNuhLWWebPIX/yuZ/PmcFLy8="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_3.0.0-beta7_1542985364952_0.10915638932042127"},"_hasShrinkwrap":false},"3.0.0-14a975b4461542cd2e108addd613a813313d32e8":{"name":"alfresco-js-api","version":"3.0.0-14a975b4461542cd2e108addd613a813313d32e8","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"dist/alfresco-js-api.js","typings":"index.d.ts","scripts":{"clean":"rimraf node_modules && npm run clean-build","clean-build":"rimraf dist","build":"npm run clean-build && grunt && npm run tslint && npm run test && npm run webpack && npm run toc","webpack":"webpack","test":"grunt test","coverage":"grunt coverage","generate":"mvn clean generate-sources","watchify":"watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js","tslint":"tslint --type-check -c tslint.json index.d.ts --project tsconfig.json ","toc":"markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md","prepublish":"npm run webpack","generate-ts":"jsdoc -c config.json .","generate-api":"mvn install"},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"babel-loader":"^7.0.0","babel-plugin-transform-proto-to-assign":"^6.9.0","babel-preset-es2015":"^6.24.1","babel-preset-es2015-loose":"^8.0.0","babel-preset-es2015-rollup":"^3.0.0","babelify":"^7.3.0","chai":"^3.5.0","chai-datetime":"^1.4.1","expect.js":"~0.3.1","grunt":"~0.4.0","grunt-cli":"^1.1.0","grunt-contrib-jshint":"^1.0.0","grunt-coveralls":"^1.0.0","grunt-istanbul":"^0.7.0","grunt-jscs":"^2.8.0","grunt-mocha-istanbul":"^3.0.1","grunt-mocha-test":"0.13.3","grunt-open":"^0.2.3","load-grunt-tasks":"^3.4.1","markdown-toc":"^0.12.14","mocha":"5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","tsd-jsdoc":"^2.0.0-beta.3","tslint":"5.7.0","typescript":"^2.4.0","uglifyjs-webpack-plugin":"^1.2.3","watchify":"^3.7.0","webpack":"4.1.1","webpack-cli":"2.0.12"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"keywords":["alfresco"],"gitHead":"14a975b4461542cd2e108addd613a813313d32e8","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-14a975b4461542cd2e108addd613a813313d32e8","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-CPnja3hsaUt0vCR08F3HAZbsEGhOnq6RXRAlgyTwpo2HwkogqIHKh6kOpdrNCy753Gx4F3ge6qeO5UEiYSfvpA==","shasum":"adfbd94f92b2fb49bce56e3c461c567d6210ae98","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-14a975b4461542cd2e108addd613a813313d32e8.tgz","fileCount":1179,"unpackedSize":7066552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcESDPCRA9TVsSAnZWagAAQEUP/11uR/1lH2MJ4esH9DpG\nEAGxLxL8MST46CBWsFkgvYhtTyXWY+bx7ayHWkFBNIFeRc7AEHeDI3tagJ2Q\nUU74bZrqcwFqm1gFcVUOkL9S56mL8D0sml4nQ7x1FMcb/VRcu4zYxSc3J5RK\nFwmPOSO0xZTM+gAiHBL2i/SwSfeblIIryFDKp5fn//WYhRMGAdi6F5d38J1W\nlo4lELETx/xWKqufddelsCl55myTzT1KYwPW5l2YnbFCPuR2L76SvU8TIr82\nsHx+5OoD1xWvEtCVowHhI4YU+wGLPeiq6gvojFX646+ytKlGRxg5ny5bWJ/N\nBrQvBbNexM2MY2S+5NST7Uk1aZH3ZXzMM0AczND45qjPfJxYm/neibt1/rzb\nvmto+nFja+13R07i9HCrnvAa7kDir8XSrGk6bruaYmbmiHKtVlKjSMA1Y6YB\n5DdoKUhXH5f9Bso8+fh5/TfVuxTtol9b51E8qZUB//swIoeeyBw8gt6d8epH\nyrQb4Rjpvk31CDWI8vwXGEtpyCBliAudJPlifTTKb8XqW1PPeLdCLndKZ93/\nHCos3Rv2/sdU6YpuzijgBRh3IUzyhJQhGpszs4FKbDwkNlEAnVkLbKnS3vdo\n5fWeF0/j0eIxMa1mZeY/V1gONFBGQ+WWbK2Kkvds9tkP26uZQvUTjvM1sEqm\nfUNj\r\n=kkGY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEK8e5km8DxRY/X2HMRB+3XgX7SBRYsWmdWoGFF8djguAiEA+ljm5ShYDraT2h0nxnFHnYQ4AAfIoEdRXmgSND5XQ2o="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_3.0.0-14a975b4461542cd2e108addd613a813313d32e8_1544626382589_0.9259283322832292"},"_hasShrinkwrap":false},"3.0.0-delta1":{"name":"alfresco-js-api","version":"3.0.0-delta1","description":"JavaScript client library for the Alfresco REST API","author":{"name":"Alfresco Software, Ltd."},"main":"./index.js","typings":"./index.d.ts","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"dependencies":{"btoa":"^1.2.1","event-emitter":"0.3.4","superagent":"3.8.2"},"devDependencies":{"@types/chai":"^4.1.6","@types/mocha":"^5.2.5","@types/node":"^10.12.0","@types/superagent":"3.8.2","adf-tslint-rules":"0.0.6","bundlesize":"^0.15.3","chai":"4.2.0","chai-datetime":"1.5.0","expect.js":"~0.3.1","fs-extra":"5.0.0","google-closure-compiler-js":"20170218.0.0","klaw-sync":"3.0.2","markdown-toc":"^0.12.14","minimist":"1.2.0","mocha":"^5.2.0","mocha-lcov-reporter":"^1.2.0","nock":"8.1.0","npm-run-all":"^4.1.5","remove-comments-loader":"0.1.2","rimraf":"^2.5.2","rollup":"0.66.6","rollup-plugin-alias":"1.4.0","rollup-plugin-inject":"2.0.0","rollup-plugin-node-resolve":"2.0.0","shx":"^0.3.2","sinon":"^1.17.3","sinon-chai":"^2.8.0","ts-node":"^7.0.1","tslint":"^5.7.0","typescript":"^2.4.0","typescript-formatter":"^7.2.2"},"license":"Apache-2.0","contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"bundlesize":[{"path":"./dist/global/alfresco-js-api.umd.js","maxSize":"85 kb"}],"keywords":["alfresco"],"module":"./_esm5/index.js","es2015":"./_esm2015/index.js","readme":"# Alfresco JavaScript API Client\n\n\n<p>\n  <a title='Gitter chat' href=\"https://gitter.im/Alfresco/alfresco-ng2-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\">\n     <img src='https://badges.gitter.im/Alfresco/alfresco-ng2-components.svg'  alt='Gitter chat' />\n  </a>\n  <a title='Build Status' href=\"https://travis-ci.org/Alfresco/alfresco-js-api\">\n     <img src='https://travis-ci.org/Alfresco/alfresco-js-api.svg?branch=master'  alt='travis Status' />\n  </a>\n  <a href='https://codecov.io/gh/Alfresco/alfresco-js-api'>\n    <img src='https://img.shields.io/codecov/c/github/Alfresco/alfresco-js-api/master.svg?maxAge=0' alt='Coverage Status' />\n  </a>\n  <a href='https://raw.githubusercontent.com/Alfresco/dev-platform-js-api/master/LICENSE'>\n     <img src='https://img.shields.io/hexpm/l/plug.svg' alt='license' />\n  </a>\n\n</p>\n\n<p align=\"center\">\n  <img title=\"alfresco\" alt='alfresco' src='assets/alfresco.png'  width=\"280px\" height=\"150px\"></img>\n</p>\n\nThis project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.\n\n<!-- markdown-toc start - Don't edit this section.  npm run toc to generate it-->\n\n<!-- toc -->\n\n- [Full documentation of all the methods of each API](#full-documentation-of-all-the-methods-of-each-api)\n- [Prerequisites](#prerequisites)\n- [Node](#node)\n- [Api Modules complete methods list](#api-modules-complete-methods-list)\n- [Install](#install)\n- [Use](#use)\n    + [Import library for node projects](#import-library-for-node-projects)\n    + [Import library for browser projects](#import-library-for-browser-projects)\n- [Authentication JS-API](#authentication-js-api)\n  * [Login](#login)\n    + [Login with Username and Password BPM and ECM](#login-with-username-and-password-bpm-and-ecm)\n      - [Example](#example)\n    + [Login with Username and Password ECM](#login-with-username-and-password-ecm)\n      - [Example](#example-1)\n    + [Login with ticket](#login-with-ticket)\n      - [Login with ticket ECM](#login-with-ticket-ecm)\n      - [Example](#example-2)\n      - [Login with ticket ECM/BPM as parameter in the constructor](#login-with-ticket-ecmbpm-as-parameter-in-the-constructor)\n        * [Example](#example-3)\n    + [Login with Username and Password BPM](#login-with-username-and-password-bpm)\n    + [Example](#example-4)\n    + [Login with OAUTH2 Alfresco authorization server](#login-with-oauth2-alfresco-authorization-server)\n  * [Implicit Flow](#implicit-flow)\n      - [oauth2 properties](#oauth2-properties)\n      - [Events](#events)\n    + [Example](#example-5)\n    + [Example skip login form](#example-skip-login-form)\n  * [Password Flow](#password-flow)\n    + [Example](#example-6)\n    + [Example](#example-7)\n  * [Logout](#logout)\n    + [Example](#example-8)\n  * [isLoggedIn](#isloggedin)\n    + [Example](#example-9)\n  * [Get tickets](#get-tickets)\n  * [Events login/logout](#events-loginlogout)\n    + [Example](#example-10)\n- [Custom Endpoint](#custom-endpoint)\n  * [Example](#example-11)\n- [ECM](#ecm)\n  * [Get Node  content](#get-node--content)\n    + [Example](#example-12)\n  * [Get File or Folder Info](#get-file-or-folder-info)\n    + [Example](#example-13)\n  * [Get Folder Children Info](#get-folder-children-info)\n    + [Example](#example-14)\n  * [Create Folder](#create-folder)\n    + [Example](#example-15)\n    + [Example](#example-16)\n  * [Upload File](#upload-file)\n    + [Example](#example-17)\n  * [Events Upload File](#events-upload-file)\n    + [Example](#example-18)\n  * [Delete File or Folder](#delete-file-or-folder)\n    + [Example](#example-19)\n  * [Delete File or Folder Permanent](#delete-file-or-folder-permanent)\n    + [Example](#example-20)\n  * [Get thumbnail Url](#get-thumbnail-url)\n    + [Example](#example-21)\n  * [Get preview Url](#get-preview-url)\n    + [Example](#example-22)\n  * [Get content Url](#get-content-url)\n    + [Example](#example-23)\n  * [Custom web scripts call](#custom-web-scripts-call)\n    + [Parameters](#parameters)\n- [BPM](#bpm)\n  * [Task Api](#task-api)\n    + [List Task](#list-task)\n      - [Parameters](#parameters-1)\n      - [Example](#example-24)\n    + [Get Task](#get-task)\n      - [Parameters](#parameters-2)\n      - [Example](#example-25)\n    + [Filter Task](#filter-task)\n      - [Parameters](#parameters-3)\n      - [Example](#example-26)\n    + [Complete Task](#complete-task)\n      - [Parameters](#parameters-4)\n      - [Example](#example-27)\n    + [Get Task Form](#get-task-form)\n      - [Parameters](#parameters-5)\n      - [Example](#example-28)\n    + [Complete Task Form](#complete-task-form)\n      - [Parameters](#parameters-6)\n      - [Example](#example-29)\n  * [Process Api](#process-api)\n    + [Get Process Instances](#get-process-instances)\n      - [Parameters](#parameters-7)\n      - [Example](#example-30)\n  * [Models Api](#models-api)\n    + [Get Model](#get-model)\n      - [Parameters](#parameters-8)\n      - [Example](#example-31)\n  * [Report Api](#report-api)\n    + [Create default Reports](#create-default-reports)\n      - [Parameters](#parameters-9)\n      - [Example](#example-32)\n    + [Get Reports](#get-reports)\n      - [Parameters](#parameters-10)\n      - [Example](#example-33)\n    + [Report Params](#report-params)\n      - [Parameters](#parameters-11)\n      - [Example](#example-34)\n  * [Report Process Definitions](#report-process-definitions)\n      - [Parameters](#parameters-12)\n      - [Example](#example-35)\n  * [Tasks of process definition](#tasks-of-process-definition)\n      - [Parameters](#parameters-13)\n      - [Example](#example-36)\n  * [Generate reports](#generate-reports)\n      - [Parameters](#parameters-14)\n      - [Example](#example-37)\n  * [Update report details](#update-report-details)\n      - [Parameters](#parameters-15)\n      - [Example](#example-38)\n  * [Export to csv](#export-to-csv)\n      - [Parameters](#parameters-16)\n      - [Example](#example-39)\n  * [Save Report](#save-report)\n      - [Parameters](#parameters-17)\n      - [Example](#example-40)\n  * [Delete report](#delete-report)\n      - [Parameters](#parameters-18)\n      - [Example](#example-41)\n- [Error Events](#error-events)\n  * [Example](#example-42)\n- [Development](#development)\n- [Release History](#release-history)\n\n<!-- tocstop -->\n\n<!-- markdown-toc end -->\n\n# Full documentation of all the methods of each API\n\n- [Authentication Services](/src/alfresco-auth-rest-api)\n- [Content Services](/src/alfresco-core-rest-api)\n- [Process Services](/src/alfresco-activiti-rest-api)\n- [ContentCMN](/src/alfresco-private-rest-api)\n- [Content Search](/src/alfresco-search-rest-api)\n\n# Prerequisites\n\nTo correctly use the alfresco js api the minimal supported version are:\n\n- 5.2.a-EA Alfresco Platform Repository (version [5.2.a-EA](https://wiki.alfresco.com/wiki/Community_file_list_201606-EA) or newer)\n- 1.5 Activiti\n\n# Node\nTo correctly use the alfresco-js-api in node check that on your machine is running Node version 5.0.0 or higher.\n\n# Api Modules complete methods list\n\n- [Authentication API](/src/alfresco-auth-rest-api)\n- [Core API](/src/alfresco-core-rest-api)\n- [Governance core API](/src/alfresco-gs-core-rest-api)\n- [Governance classification API](/src/alfresco-gs-classification-rest-api)\n- [Discovery API](/src/alfresco-discovery-rest-api)\n- [Search API](/src/alfresco-search-rest-api)\n- [Activiti API](/src/alfresco-activiti-rest-api)\n- [Mock API](/test/mockObjects)\n\n# Install\n\n\nInstaller for browser versions:\n\n```sh\nnpm install --save alfresco-js-api\n```\n\nInstaller for node versions:\n\n```sh\nnpm install --save alfresco-js-api-node\n```\n\n\n# Use\n\n### Import library for node projects\n\n```javascript\nvar AlfrescoApi = require('alfresco-js-api-node');\n```\n\n### Import library for browser projects\n\n```html\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.min.js\"></script>\n\n    or for not minify version\n\n    <script src=\"node_modules/alfresco-js-api/dist/alfresco-js-api.js\"></script>\n```\n\n\n# Authentication JS-API\n\n## Login\n\nAlfrescoApi({alfrescoHost, activitiHost, contextRoot, ticket});\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhostEcm| (Optional value The Ip or Name of the host where your Alfresco instance is running )|http://127.0.0.1:8080 |\nhostBpm| (Optional value The Ip or Name of the host where your Activiti instance is running )|http://127.0.0.1:9999 |\nauthType|  (Optional value can be 'BASIC' or 'OAUTH') | 'BASIC'|\noauth2|  (Optional configuration for SSO) ||\ncontextRoot| (Optional value that define the context Root of the Alfresco ECM API default value is alfresco )|alfresco |\ncontextRootBpm| (Optional value that define the context Root of the Activiti API default value is activiti-app )|alfresco |\nprovider| (Optional value default value is ECM. This parameter can accept as value ECM BPM or ALL to use the API and Login in the ECM, Activiti BPM or Both )|alfresco |\nticket| (Optional only if you want login with the ticket see example below)| |\ndisableCsrf| To disable CSRF Token to be submitted. Only for Activiti call.| false |\nwithCredentials| (Optional configuration for SSO, requires CORS on ECM) |false\n\n### Login with Username and Password BPM and ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'ALL' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in  BPM and ECM performed ');\n}, function (error) {\n    console.error(error);\n});\n```\n\n\n### Login with Username and Password ECM\n\n#### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi();\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login ticket:' + data);\n}, function (error) {\n    console.error(error);\n});\n\n//The output will be: API called successfully Login ticket: TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1\n\n```\n\n### Login with ticket\n\nIf you already know thw ticket when you invoke the constructor you can pass it as parameter in the constructor otherwise you can call the login with ticket that will validate the ticket against the server\n\n\n#### Login with ticket ECM\n\nThis authentication validate also the ticket against the server\n\n#### Example\n```javascript\nvar ticket = 'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1';\n\nthis.alfrescoJsApi.loginTicket(ticket).then(function (data) {\n             console.log('valid ticket you are logged in');\n         }, function (error) {\n             console.error(error);\n         });\n```\n\n#### Login with ticket ECM/BPM as parameter in the constructor\n\nWith this authentication the ticket is not validated against the server\n\n##### Example\n```javascript\n\n//Login ticket ECM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1',  hostEcm:'http://127.0.0.1:8080'});\n\n//Login ticket BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostBpm:'http://127.0.0.1:9999'});\n\n//Login ticket ECM and BPM\nthis.alfrescoJsApi = new AlfrescoApi({ ticketEcm:'TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1', ticketBpm: 'Basic YWRtaW46YWRtaW4=',  hostEcm:'http://127.0.0.1:8080',  hostBpm:'http://127.0.0.1:9999'});\n```\n\n### Login with Username and Password BPM\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({ provider:'BPM' });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n    console.log('API called successfully Login in Activiti BPM performed ');\n}, function (error) {\n    console.error(error);\n});\n\n```\n### Login with OAUTH2 Alfresco authorization server\n\n## Implicit Flow\n\nIf your want to be redirect to the authorization server and login there you can use the implicit flow to login\n\n#### oauth2 properties\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nhost| Your oauth2 server URL| null |\nclientId| Your clientId oauth2 | null |\nsecret| Your secret oauth2| null |\nscope| Your scope | null |\nimplicitFlow| true/false | false |\nredirectUri|  url to be redirect after login| null|\nredirectLogout|  url to be redirect after logout optional, if is nor present the redirectUri will be used| null|\nrefreshTokenTimeout|  millisecond value, after how many millisecond youw ant refresh the token| 40000|\nredirectSilentIframeUri|  url to be redirect after silent refresh login| /assets/silent-refresh.html |\nsilentLogin|  direct execute the implicit login without the need od call this.alfrescoJsApi.implicitLogin() method|   false|\n\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n#### Events\n\nProperty | Description  | default value|\n------------- | ------------- | -------------|\nimplicit_redirect| triggered when the user is redirect to the auth server return url parameter of the redirect |  |\ndiscovery| triggered when all the openId discovery url phase is terminated returnl an object with all the discovered url |  |\ntoken_issued| triggered when a new token is issued|  |\n\nThe alfresco-js-api will automatically redirect you to the login page anf refresh the token if necessary\n\n\n### Example\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\nthis.alfrescoJsApi.implicitLogin();\n\n```\n\n### Example skip login form\n\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            scope: 'openid',\n            implicitFlow: true,\n            redirectUri: 'YOUR_HOME_APP_URL',\n            silentRefreshTimeout: '600000' //Optional parameter 10 minutes default value,\n            silentLogin: true\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n});\n\n```\n\n\n## Password Flow\n\nIf your auth endpoint is different from the standard one \"/oauth/token\" you can override it through the property authPath\n\n### Example\n```javascript\nthis.alfrescoJsApi = new AlfrescoApi({\n        oauth2: {\n            host: 'HOST_OAUTH2_SERVER',\n            clientId: 'YOUR_CLIENT_ID',\n            secret: 'SECRET',\n            authPath:'my-custom-auth-endpoint/token'\n        },\n        authType: 'OAUTH',\n        provider: 'ALL'\n    });\n\nthis.alfrescoJsApi.login('admin', 'admin').then(function (data) {\n   console.log('API called successfully Login in with authorization server performed ');\n}, function (error) {\n   console.error(error);\n});\n\n```\n\nAfter the login if you want refresh your token you can use this call\n\n### Example\n\n```javascript\nthis.alfrescoJsApi.refreshToken()then(function (data) {\n    console.log('Your token has been refreshed');\n }, function (error) {\n    console.error(error);\n });\n```\n\n## Logout\n\nlogout()\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.logout().then(function (data) {\n    console.log('Successfully Logout');\n}, function (error) {\n    console.error('Possible ticket already expired');\n});\n\n```\n\n## isLoggedIn\n\nisLoggedIn()\n\n> return true if you are logged in false if you are not.\n\n### Example\n\n```javascript\n\nvar isLoggedIn = this.alfrescoJsApi.isLoggedIn();\n\nif (isLoggedIn) {\n    console.log('You are logged in');\n} else {\n    console.log('You are not logged in');\n}\n\n```\n## Get tickets\n\ngetTicketEcm()\n\n>After the log in you can retrieve you ECM ticket\n\n```javascript\n var ecmTicket = this.alfrescoJsApi.getTicketEcm() ;\n console.log('This is your  ECM ticket  ' + ecmTicket);\n\n```\n\ngetTicketBpm()\n\n>After the log in you can retrieve you BPM ticket\n\n```javascript\n\n var bpmTicket  = this.alfrescoJsApi.getTicketBpm();\n console.log('This is your BPM ticket ' + bpmTicket);\n```\n\n## Events login/logout\n\n>  The login/logout are also an EventEmitter which you can register to listen to any of the following event types:\n* unauthorized (If this event is triggered a call to the Api was unauthorized)\n* success (If this event is triggered the login was success you can use this event instead the login promise)\n* logout (If this event is triggered the client is successfully logout)\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.login('admin', 'admin').on('unauthorized', function(){\n    console.log('You are unauthorized you can use this event to redirect to login');\n});\n\nthis.alfrescoJsApi.login('admin', 'admin').on('success', function(){\n    console.log('Success Login');\n});\n\nthis.alfrescoJsApi.logout().on('logout', function(){\n    console.log('Successfully Logout');\n});\n```\n\n# Custom Endpoint\n\nContent service and process service has two different clients:\n\n-  this.alfrescoJsApi.ProcessClient\n-  this.alfrescoJsApi.ContentClient\n\nBoth client expose a method ***callApi**\n\n\n```javascript\n    callApi(path: string, httpMethod: string, pathParams?: any, queryParams?: any, headerParams?: any, formParams?: any, bodyParam?: any, authNames?: string[], contentTypes?: string[], accepts?: string[], returnType?: any, contextRoot?: string, responseType?: string): Promise<any>;\n```\n\nIf you want call your custom rest point in one of those two service use the corrispondin client. \n\n## Example\n\n```javascript\n\n    this.alfrescoJsApi.bpmClient.callApi(\n        '/api/enterprise/app-version', 'GET',\n        {}, {}, {}, {}, {},\n        [],  ['application/json'], ['application/json'], {'String': 'String'}\n    )\n\n ```\n        \n\n# ECM\n\nA complete list of all the ECM methods is available here : [Core API](/src/alfresco-core-rest-api).\nBelow you can find some common examples.\n\n## Get Node  content\n\ngetFileContent(nodeId, opts)\n\n>Returns the file content of the node with identifier **nodeId**.\n\n ### Example\n```javascript\n\nvar nodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.core.nodesApi.getFileContent(nodeId).then(function(data) {\n    fs.writeFile('./test/grass.jpg', data, function(error) {\n        if (error) {\n            console.error(error);\n            return;\n        }\n        console.log('The file was saved!');\n    });\n}, function(error) {\n    console.error(error);\n});\n```\n\n## Get File or Folder Info\n\ngetNodeInfo(fileOrFolderId, opts)\n\n>Get information for the File/Folder with the identifier nodeId. The identifier of a node. You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeInfo(fileOrFolderId).then(function (data) {\n    console.log('This is the name' + data.name );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Get Folder Children Info\n\ngetNodeChildren(fileOrFolderId, opts)\n\n>Minimal information for each child is returned by default.\nYou can use the include parameter to return additional information.\nreturns a promise with the Info about the children of the node if resolved and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as NodeId\n\n### Example\n\n```javascript\n\nvar folderNodeId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.getNodeChildren(folderNodeId).then(function (data) {\n    console.log('The number of children in this folder are ' + data.list.pagination.count );\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n## Create Folder\n\ncreateFolder(name, relativePath, nodeIdParentFolder, opts)\n\n>createFolder return a promise that is resolved if the folder is created and {error} if rejected.\nYou can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB').then(function (data) {\n    console.log('The folder is created in  folderA/folderB from root');\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c'\n\nthis.alfrescoJsApi.nodes.createFolder('newFolderName', 'folderA/folderB', parentFolder).then(function (data) {\n    console.log('The folder is created in  folderA/folderB from parentFolder:' + parentFolder);\n}, function (error) {\n    console.log('Error in creation of this folder or folder already exist' + error);\n});\n\n```\n\n**CreateFolder With Auto Rename**\n\ncreateFolderAutoRename(name, relativePath, nodeIdParentFolder, opts)\n>is the same of createFolder(name, relativePath, nodeId, {autoRename: true}) is just syntactic sugar\n You can also use one of these well-known aliases: -my-   ,  -shared-   or   -root-  as nodeIdParentFolder\n\n### Example\n\n```javascript\n\nthis.alfrescoJsApi.nodes.createFolderAutoRename('newFolderName').then(function (data) {\n    console.log('The folder is created in root');\n}, function (error) {\n    console.log('Error in creation of this folder' + error);\n});\n```\n\n## Upload File\n\nuploadFile(fileDefinition, relativePath, nodeId, nodeBody, opts)\n>uploadFile return a promise that is resolved if the file is successful uploaded and {error} if rejected.\n\nThe fileDefinition provides information about files and allows JavaScript to access their content.\n\n*Web File Definition\nFile Definition are generally retrieved from a FileList object returned as a result of a user selecting files using the <input> element\n\n*Node File Definition\nFile Definition are generally retrieved from a read Stram\n\n### Example\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {autoRename: true})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ')\n    .then(function () {\n        console.log('File Uploaded in the from root folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n\nvar parentFolder = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, 'folderX/folderY/folderZ', parentFolder )\n    .then(function () {\n        console.log('File Uploaded in the from parentFolder ' + parentFolder + ' n folderX/folderY/folderZ');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\nThe default behaviour of the Upload API will not create any thumbnail.\nIn order to create a thumbnail you have to perform to pass the parameter ```javascript{renditions: 'doclib'}```  as in the  example below.\nThis parameter will basically perform also a call to the Rendition API.\nFor more information about the Rendition API :\n* [Rendition API](/src/alfresco-core-rest-api/docs/Rendition.md)\n* [Rendition service Wiki](https://wiki.alfresco.com/wiki/Rendition_Service)\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload, null, null, null, {renditions: 'doclib'})\n    .then(function () {\n        console.log('File Uploaded in the root');\n    }, function (error) {\n        console.log('Error during the upload' + error);\n    });\n\n```\n\n* To abort a file uploading\n\n\n```javascript\n\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nvar promiseUpload = this.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .once('abort', function () {\n        console.log('File Uploaded aborted');\n    });\n\npromiseUpload.abort();\n```\n\n\n## Events Upload File\n\n>  The uploadFile is also an EventEmitter which you can register to listen to any of the following event types:\n* progress\n* success\n* abort\n* error\n* unauthorized\n\n### Example\n\n```javascript\nvar fs = require('fs');\n\nvar fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt');\n\nthis.alfrescoJsApi.upload.uploadFile(fileToUpload)\n    .on('progress', (progress) => {\n        console.log( 'Total :' + progress.total );\n        console.log( 'Loaded :' + progress.loaded );\n        console.log( 'Percent :' + progress.percent );\n    })\n    .on('success', () => {\n       console.log( 'Your File is uploaded');\n    });\n    .on('abort', () => {\n      console.log( 'Upload Aborted');\n    })\n    .on('error', () => {\n      console.log( 'Error during the upload');\n    })\n    .on('unauthorized', () => {\n    console.log('You are unauthorized');\n    })\n```\n\n## Delete File or Folder\n\ndeleteNode(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nDeleted nodes move to the trash bin is still possible to recover it\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNode(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Delete File or Folder Permanent\n\ndeleteNodePermanent(fileOrFolderId)\n\n>Delete File/Folder with the identifier nodeId, if the nodeId is a folder, then its children are also deleted\nIf Deleted Permanent is used will not be possible recover the files\n\n### Example\n\n```javascript\n\nvar fileOrFolderId = '80a94ac8-3ece-47ad-864e-5d939424c47c';\n\nthis.alfrescoJsApi.nodes.deleteNodePermanent(fileOrFolderId).then(function (data) {\n    console.log('The file/folder is deleted');\n}, function (error) {\n    console.log('This node does not exist');\n});\n\n```\n\n## Get thumbnail Url\n\ngetDocumentThumbnailUrl(documentId)\n\n### Example\n\n```javascript\n\nvar thumbnailUrl = this.alfrescoJsApi.content.getDocumentThumbnailUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get preview Url\n\ngetDocumentPreviewUrl(documentId)\n\n### Example\n\n```javascript\n\nvar previewUrl = this.alfrescoJsApi.content.getDocumentPreviewUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Get content Url\n\ngetContentUrl(documentId)\n\n### Example\n\n```javascript\n\nvar contentUrl = this.alfrescoJsApi.content.getContentUrl('1a0b110f-1e09-4ca2-b367-fe25e4964a4');\n\n```\n\n## Custom web scripts call\n\nFor mor information about web scripts read the [Wiki](https://wiki.alfresco.com/wiki/Web_Scripts) and the [Wiki with Web ScriptsExamples](https://wiki.alfresco.com/wiki/Web_Scripts_Examples)\n\nexecuteWebScript(httpMethod, scriptPath, scriptArgs, contextRoot, servicePath)\n\n>  Anatomy of a Web Script URI  **http(s)://(host):(port)/(contextPath)/(servicePath)/(scriptPath)?(scriptArgs)**\nA Web Script is simply a service bound to a URI which responds to HTTP methods such as GET, POST, PUT and DELETE. While using the same underlying code, there are broadly two kinds of Web Scripts.\n\n### Parameters\nName | Description\n------------- | -------------\n**httpMethod**  | possible value GET, POST, PUT and DELETE\n**scriptPath**  |path to Web Script (as defined by Web Script)\n**scriptArgs**  |arguments to pass to Web Script\n**contextRoot** |path where application is deployed default value 'alfresco'\n**servicePath** |path where Web Script service is mapped default value 'service'\n**postBody** | post body\n\n```javascript\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks\n\nthis.alfrescoJsApi.core.webscriptApi.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {\n   console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n\n```\n\n# BPM\n\nA complete list of all the BPM methods is available her[Activiti API](/src/alfresco-activiti-rest-api).\nBelow you can find some common examples.\n\n## Task Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/TaskApi.md)\n\n### List Task\n\nlistTasks(requestNode)\n\n>return a list of task based on the requestNode query\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**Representation**](/src/alfresco-activiti-rest-api/docs/TaskQueryRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskQueryRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.taskApi.listTasks(requestTasks).then(function (data) {\n console.log('listTasks ' + data);\n}, function (error) {\n console.log('Error' + error);\n});\n```\n\n### Get Task\n\ngetTask(taskId)\n\n>return the [**TaskRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskRepresentation.md)  of single task by id\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTask(taskId).then(function (data) {\n    console.log('Task representation ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Filter Task\n\nfilterTasks(requestTasks)\n\n>return the [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md) that is a list of all the task filered\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestTasks** | [**TaskFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/TaskFilterRequestRepresentation.md)| requestTasks\n\n\n#### Example\n\n```javascript\n\nvar requestTasks = new this.alfrescoJsApi.activiti.TaskFilterRequestRepresentation();\nrequestTasks.appDefinitionId = 1;\n\nthis.alfrescoJsApi.activiti.taskApi.filterTasks(requestTasks).then(function (data) {\n    console.log('Task filter list ' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n### Complete Task\n\ncompleteTask(taskId)\n\n>To complete a task (standalone or without a task form) :\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTask(taskId).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n### Get Task Form\n\ngetTaskForm(taskId)\n\n>Retrieve the Task Form representation. [**FormDefinitionRepresentation**](/src/alfresco-activiti-rest-api/docs/FormDefinitionRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then(function (data) {\n   console.log('Task form representation' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n### Complete Task Form\n\ncompleteTaskForm(taskId, completeTaskFormRepresentation)\n\n>Complete a Task Form\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **taskId** | **String**| taskId\n **completeTaskFormRepresentation** | [**CompleteFormRepresentation**](/src/alfresco-activiti-rest-api/docs/CompleteFormRepresentation.md)| completeTaskFormRepresentation\n\n#### Example\n\n```javascript\n\nvar taskId = '10'; // String | taskId\n\nthis.alfrescoJsApi.activiti.taskApi.completeTaskForm(taskId, completeTaskFormRepresentation).then(function () {\n    console.log('Task completed');\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\n## Process Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Process Api documentation](/src/alfresco-activiti-rest-api/docs/ProcessApi.md)\n\n\n### Get Process Instances\n\ngetProcessInstances(requestNode)\n\n>Retrieve a list of process instances [**ResultListDataRepresentation**](/src/alfresco-activiti-rest-api/docs/ResultListDataRepresentation.md)\n\n#### Parameters\n\nName | Type | Description\n------------- | ------------- | -------------\n **requestNode** | [**ProcessFilterRequestRepresentation**](/src/alfresco-activiti-rest-api/docs/ProcessFilterRequestRepresentation.md)| requestNode\n\n#### Example\n\n```javascript\nvar requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n    console.log('All processes' + data);\n}, function (error) {\n    console.log('Error' + error);\n});\n```\n\nFiltered process:\n\n```javascript\n var requestNode = new this.alfrescoJsApi.activiti.ProcessFilterRequestRepresentation();\n\nrequestNode.page = 0;\nrequestNode.sort = 'created-desc';\nrequestNode.state = 'completed';\n\nthis.alfrescoJsApi.activiti.processApi.getProcessInstances(requestNode).then(function (data) {\n   console.log('All processes completed' + data);\n}, function (error) {\n   console.log('Error' + error);\n});\n```\n\n## Models Api\n\nBelow you can find some example relative to the Activiti process api for all the possible method go to [Task Api documentation](/src/alfresco-activiti-rest-api/docs/ModelsApi.md)\n\n### Get Model\n\ngetModel(modelId, opts)\n\n>To retrieve details about a particular model (process, form, decision rule or app) return a [**ModelRepresentation**](ModelRepresentation.md)\n\n#### Parameters\n\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------\n **modelId** | **Integer**| modelId |\n **includePermissions** | **Boolean**| includePermissions | [optional]\n\n#### Example\n```javascript\n\nvar opts = {\n    'filter': 'myReusableForms',\n    'modelType': 2\n};\n\nthis.alfrescoJsApi.activiti.modelsApi.getModels(opts).then(function (data) {\n    console.log('All your reusable forms' + data);\n }, function (error) {\n    console.log('Error' + error);\n });\n```\n\n## Report Api\n\nBelow you can find some example relative to the Activiti report api for all the possible method go to [Report Api documentation](/src/alfresco-activiti-rest-api/docs/ReportApi.md)\n\n### Create default Reports\n\ncreateDefaultReports()\n\n>Create the default reports\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.createDefaultReports();\n```\n\n### Get Reports\n\ngetReportList()\n\n> Retrieve the available report list\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getReportList();\n```\n\n### Report Params\n\ngetReportParams(reportId)\n\n> Retrieve the parameters referring to the reportId.\n\n#### Parameters\n\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.getReportParams(reportId);\n```\n\n## Report Process Definitions\n\ngetProcessDefinitions()\n\n> Retrieve the process definition list for all the apps.\n\n#### Parameters\n\nNo parameters required.\n\n#### Example\n\n```javascript\n\nthis.alfrescoJsApi.activiti.reportApi.getProcessDefinitions();\n```\n\n## Tasks of process definition\n\ngetTasksByProcessDefinitionId(reportId, processDefinitionId)\n\n> Retrieves all tasks that refer to the processDefinitionId\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **processDefinitionId** | **String**| process definition id ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar processDefinitionId = \"1\"; // String | processDefinitionId\n\nthis.alfrescoJsApi.activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId);\n```\n\n## Generate reports\n\ngetReportsByParams(reportId, paramsQuery)\n\n> Generate the reports based on the input parameters\n\n#### Parameters\nName | Type | Description  | Notes|\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **paramsQuery** | **Object**| Query parameters ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar paramsQuery = {status: 'ALL'}; // Object | paramsQuery\n\nthis.alfrescoJsApi.activiti.reportApi.getReportsByParams(reportId, paramsQuery);\n```\n## Update report details\n\nupdateReport(reportId, name)\n\n> Update the report details\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **name** | **String**| The report name ||\n\n#### Example\n\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar name = \"new Fake name\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.updateReport(reportId, name);\n```\n\n## Export to csv\nexportToCsv(reportId, queryParms)\n\n> Export a report as csv\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.exportToCsv(reportId, queryParms);\n```\n\n## Save Report\n\nsaveReport(reportId, queryParams)\n\n> Save a report\n\n#### Parameters\nName | Type | Description  | Notes\n------------- | ------------- | ------------- | -------------|\n **reportId** | **String**| reportId ||\n **queryParms** | **Object**| Query parameters ||\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\nvar queryParms = {\n            'processDefinitionId': 'TEST:99:999',\n            'dateRange': {\n                'startDate': '2017-01-01T00:00:00.000Z',\n                'endDate': '2017-01-24T23:59:59.999Z',\n                'rangeId': 'currentYear'\n            },\n            'slowProcessInstanceInteger': 10,\n            'status': 'All',\n            '__reportName': 'FAKE_REPORT_NAME'\n        };\n\nthis.alfrescoJsApi.activiti.reportApi.saveReport(reportId, queryParms);\n```\n\n## Delete report\ndeleteReport(reportId)\n\n> Delete a report\n\n#### Parameters\nName | Type | Description  | Notes |\n------------- | ------------- | ------------- | ------------- |\n **reportId** | **String**| reportId | |\n\n#### Example\n```javascript\n\nvar reportId = \"1\"; // String | reportId\n\nthis.alfrescoJsApi.activiti.reportApi.deleteReport(reportId);\n```\n\n# Error Events\n\nThe alfresco-js-api has an error handler event where you can subscribe\n\n## Example\n```javascript\n    this.alfrescoJsApi.on('error', (error) => {\n        console.log(error)\n    })\n```\n\n# Development\n\n* To run the build\n\n    ```$ npm run build```\n\n* To run the build in watch mode\n\n    ```$ npm run watchify```\n\n* To run the test\n\n    ```$ npm run test```\n\n* To run the test coverage\n\n    ```$ npm run coverage```\n\n\n# Release History\n\nRead the [Changelog] (./CHANGELOG.md)\n\n","readmeFilename":"README.md","homepage":"https://github.com/Alfresco/alfresco-js-api#readme","_id":"alfresco-js-api@3.0.0-delta1","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"alfresco","email":"build@alfresco.com"},"dist":{"integrity":"sha512-UplfqgM84tsCzbQ0OoB176N31AIt4Jc/yo+iFQcUo40DYxHzbxIAr5x3+xoan0OGGuBRWCy7Q73mb7NhH5LtvA==","shasum":"e1800ed9cf8d7005019dba68a089607ced9818ef","tarball":"https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-3.0.0-delta1.tgz","fileCount":6280,"unpackedSize":17556512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHK+6CRA9TVsSAnZWagAAIjoP/20mK1RnxjuL2zq5crSI\ntlyIh3iEZZR6nb9zMmPjcWsRmXL94Cj3i4sTF61pgDBx2yXxNKufn+ddGyx7\nCpz2GR9/k0cu0PMZVXULudjupYP85tBbcCBUUg8eOdIo2cyv3Vb5hJaCqhvM\nyANlr3lnRmxG1TrN+5PZqTqDwWjqPk4IWl+Nnq8oTHTFTJ7apuvmj7g64+iw\nV8ySnU0hyi+/OPYyxlicDDx3bVWzMFrCkSoX15H0scp7Pgd6tB/gTDU2J304\nghGon6JAV0LtZpeKqGrLrQi/6d31/vXV9wzWQwzTgW7173tLtGMLhjtxH63/\n5d46fXnbPXaHST3wpinqnrHXfrVPoWq70k7trGjqiof4LxFnhlxGN9FYI/M6\n5FcTufykXlKGWJOqsRpTuJkqo/X2ytLNW1jOiFPnvNGyTLkcGslzNVKTFThN\niCt3/7Mo0HaGLlCl8t1j43gc80IATX4G01/JIx47o4Ge/0Z7qXwC4T9W0rpG\n/rNMWLC5N0FUMwaX0ri0goRA6hwfH+ajodTRHbxA+6Abj9I/onzobG3vSmf/\nhECeut7yCNmCRDJnz6nPuFJfEw1m1nTjg0LeQr0zTtctHhIX80ZWJRP77Rwg\na6Hwemgro8E0HAXBlYSd2XmDHICAv9yd3+CRe+8Gl/VZRHZ9K7XTUNXVGh77\nhMGE\r\n=/cRY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGlyzbk5i0DPi2uJBiGa5Ppyy0Ku8v19TAL1w90dkp19AiEAkFsY4YnfLcanfWVaPWpN9+ys5YIppwdrImLyT0ekEXU="}]},"maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alfresco-js-api_3.0.0-delta1_1545383865480_0.6180140057596453"},"_hasShrinkwrap":false}},"readme":"","maintainers":[{"name":"alfresco","email":"mario.romano@alfresco.com"}],"time":{"modified":"2022-06-13T02:37:28.775Z","created":"2016-06-29T21:06:23.567Z","0.1.0":"2016-06-29T21:06:23.567Z","0.2.0":"2016-07-08T21:35:58.216Z","0.2.1":"2016-07-15T14:54:56.547Z","0.2.2":"2016-07-21T10:03:41.683Z","0.3.0":"2016-08-23T15:50:50.259Z","0.3.1":"2016-09-02T09:46:11.567Z","0.3.2":"2016-09-21T10:05:57.622Z","0.3.3":"2016-09-26T10:27:35.443Z","0.3.4":"2016-09-26T17:31:55.680Z","0.3.5":"2016-09-26T20:18:56.781Z","0.3.6":"2016-10-28T18:54:06.680Z","0.3.7":"2016-10-30T13:08:22.411Z","0.3.8":"2016-11-04T15:08:54.721Z","0.4.0":"2016-11-11T22:18:03.644Z","0.5.0":"2016-11-25T19:01:24.829Z","0.5.1":"2016-12-05T12:01:22.468Z","0.5.2":"2016-12-05T13:15:06.938Z","0.5.3":"2016-12-06T12:05:46.292Z","0.5.4":"2016-12-06T18:47:28.908Z","0.5.5":"2016-12-13T16:17:55.633Z","1.0.0":"2016-12-20T17:10:46.361Z","1.1.0":"2017-01-27T14:29:04.231Z","1.1.1":"2017-01-27T16:48:27.500Z","1.2.0":"2017-02-27T15:41:41.306Z","1.2.1":"2017-03-06T15:43:17.090Z","1.2.2":"2017-03-06T17:59:39.001Z","1.3.0":"2017-04-04T11:41:10.808Z","1.4.0":"2017-04-27T14:22:16.554Z","1.5.0":"2017-05-25T19:35:19.607Z","1.6.0-beta1":"2017-06-02T11:16:58.921Z","1.6.0-beta2":"2017-06-05T14:03:08.223Z","1.6.0-beta3":"2017-06-05T15:24:14.480Z","1.6.0-beta4":"2017-06-05T17:10:52.564Z","1.6.0-beta5":"2017-06-12T14:03:12.548Z","1.6.0-beta6":"2017-06-19T14:02:59.671Z","1.6.0-beta7":"2017-06-23T09:09:51.993Z","1.6.0-beta8":"2017-06-23T12:46:23.734Z","1.6.0-beta9":"2017-06-26T11:11:48.435Z","1.6.0-beta10":"2017-06-26T12:35:51.171Z","1.6.0-beta11":"2017-06-26T13:34:18.510Z","1.6.0-beta12":"2017-06-26T14:06:28.831Z","1.6.0-beta13":"2017-06-26T14:33:35.355Z","1.6.0-beta14":"2017-06-28T16:38:53.894Z","1.6.0-beta15":"2017-06-29T09:38:32.674Z","1.6.0-beta16":"2017-06-29T15:01:50.411Z","1.6.0":"2017-06-29T15:11:40.700Z","1.6.1":"2017-06-29T21:03:58.415Z","1.7.0-beta16":"2017-07-03T14:09:56.057Z","1.7.0-beta17":"2017-07-10T14:10:08.322Z","1.7.0-beta18":"2017-07-14T14:02:32.184Z","1.7.0-alpha241ae97c4263709fdff019e198dad4c863162b3f":"2017-07-20T11:05:11.277Z","1.7.0-241ae97c4263709fdff019e198dad4c863162b3f":"2017-07-20T11:20:25.080Z","1.7.0-beta19":"2017-07-21T14:01:32.333Z","1.7.0-d44f0e3374d6ed0bd35503cdb347504b00afc21c":"2017-07-25T08:58:56.931Z","1.7.0-f56c9e700fd4b855ac1fbc535bbddbdb51f42629":"2017-07-26T17:04:06.174Z","1.7.0-e06a9f7144b53361383a907b88c20aeb3639d1dd":"2017-07-26T17:34:59.614Z","1.7.0-beta20":"2017-07-28T14:02:07.570Z","1.7.0-56f5f0ba9cdf9e50ca571c374c3a6911ec70d6ba":"2017-07-31T19:43:03.823Z","1.7.0-4a327805c923d8453bdabd61622c86d37864cf1f":"2017-07-31T19:48:52.837Z","1.7.0":"2017-08-01T08:56:15.919Z","1.8.0-11d5599014613ba112c5ae080b4da6824857eed0":"2017-08-03T09:52:09.405Z","1.8.0-c422a3b69b1b96f72abc61ab370eff53590f8ee4":"2017-08-03T15:19:16.096Z","1.8.0-beta21":"2017-08-04T14:02:29.492Z","1.8.0-beta1":"2017-08-04T15:46:24.706Z","1.8.0-6f5160df32f7feae4c3a899b5d95940595772619":"2017-08-08T09:46:06.191Z","1.8.0-d18dfb83c6c7c9cefc7f3cf8d2dafeb417e47800":"2017-08-09T17:40:11.095Z","1.8.0-beta2":"2017-08-11T14:01:55.999Z","1.8.0-beta3":"2017-08-11T14:37:28.129Z","1.8.0-beta4":"2017-08-11T14:56:39.383Z","1.8.0-9feb5d0164d6c5f994df8758e41ed126a8f69db2":"2017-08-14T15:27:44.056Z","1.8.0-beta5":"2017-08-18T14:22:59.800Z","1.8.0-beta6":"2017-08-25T14:01:44.922Z","1.8.0-beta7":"2017-09-01T14:01:45.113Z","1.8.0-b61ce4eb17fa24ca248ad00038b78b26d814f943":"2017-09-05T10:12:50.439Z","1.8.0":"2017-09-05T14:45:07.292Z","1.9.0-beta1":"2017-09-11T16:25:01.459Z","1.9.0-ff96bb801e0e9be60b85248485e5462915657de1":"2017-09-14T11:49:52.854Z","1.9.0-1c9d7d88c65e85189eee82768d5782ad7af935fb":"2017-09-14T18:55:56.972Z","1.9.0-ff0e98f1f324ecf5c677b7ebed8dd96a9c84e5e3":"2017-09-15T09:52:48.121Z","1.9.0-beta2":"2017-09-15T18:23:05.155Z","1.9.0-beta3":"2017-09-15T18:56:13.271Z","1.9.0-f8dc41f05b163babb95dc1857ab1adb819e73933":"2017-09-18T16:04:47.861Z","1.9.0-beta4":"2017-09-22T14:01:47.611Z","1.9.0-beta5":"2017-09-24T15:23:12.935Z","1.9.0-beta6":"2017-09-24T16:04:41.433Z","1.9.0-beta7":"2017-09-29T14:01:48.119Z","1.9.0-beta8":"2017-09-29T15:52:59.790Z","1.9.0-beta9":"2017-09-29T17:52:08.666Z","1.9.0-1a4a5bf12361a7829048bbb055a612ad8450119f":"2017-10-04T16:58:43.851Z","1.9.0-beta10":"2017-10-06T14:00:55.190Z","1.9.0-361d8a2ef40b4065d91c20f7874964f4076cd0ef":"2017-10-06T14:37:43.250Z","1.9.0-7a44e8b4b78feecfa493cde6a176f26aef9329ac":"2017-10-09T10:25:42.953Z","1.9.0":"2017-10-09T16:23:16.010Z","1.10.0-f280fcf0ca3ff0d5b5a8cdd3895ae5c021255c39":"2017-10-11T12:46:45.472Z","1.10.0-3c6d7f506fff6cfc66767f85c4b6eaed96e6b9c0":"2017-10-13T13:07:34.300Z","1.10.0-beta1":"2017-10-13T14:01:27.738Z","1.10.0-fe41c7a612562143aabb3dddfc1093fee5e4c472":"2017-10-17T17:46:32.954Z","1.10.0-beta2":"2017-10-20T14:01:26.437Z","1.10.0-beta3":"2017-10-20T15:14:42.865Z","1.10.0-40cd394e0fc8214fbbc659484e370e6c3cc0901e":"2017-10-24T16:19:35.869Z","1.10.0-86194ff764a25ffd90a1ccd04817c1123ecd05dd":"2017-10-24T17:04:36.546Z","1.10.0-1b950d165ae7107159b02fd75680f782d825d5cf":"2017-10-24T21:58:27.382Z","1.10.0-512ce97b552d42cad9c713fa3cbea229c0dc519c":"2017-10-25T13:02:25.546Z","1.10.0-11228ed731b8894881989e2ec62e3f3390d91636":"2017-10-26T13:56:21.290Z","1.10.0-beta4":"2017-10-27T14:02:17.082Z","1.10.0-beta5":"2017-10-31T17:57:15.432Z","1.10.0-6a33f81d4052d76586d4443defdb7a55de28cc1e":"2017-11-02T16:19:13.884Z","1.10.0-69bdb7528f216a0cdeb92f04594121124fd95033":"2017-11-02T17:46:09.720Z","1.10.0-c3eb559911efc0a3297a6c770954fe0011a25245":"2017-11-03T14:35:26.070Z","1.10.0-79d7c47d02f9910e657fea48a4f7d4d37a218959":"2017-11-03T14:37:06.300Z","1.10.0-beta6":"2017-11-03T15:01:08.955Z","1.10.0-beta7":"2017-11-10T15:01:15.459Z","2.0.0-de41fd8ca9c1c6f6072d2e06415eef0a71330dc0":"2017-11-14T14:22:12.701Z","2.0.0-0fb708e3e63eaac6e33a18b9393f561c4e1129b1":"2017-11-14T16:16:17.975Z","2.0.0-d5da84a4c1ce12638a47f33e2fa78174af0e70ae":"2017-11-14T17:28:09.829Z","2.0.0-a5057a6373212ca42e5c29a1a2550cc78dca53ad":"2017-11-17T15:19:11.616Z","2.0.0-beta1":"2017-11-18T14:48:00.205Z","2.0.0-2e4554a3d3a1265d058795c924d55d570dd46de2":"2017-11-22T14:46:17.046Z","2.0.0-beta2":"2017-11-24T15:01:03.335Z","2.0.0-6a3be5a507ee0d34968b4cd633c5e2e0ee3cb8d1":"2017-11-29T09:19:16.530Z","2.0.0-b8ce520e2ee79208f9076efc488a7dc353c2a715":"2017-11-29T09:40:52.874Z","2.0.0-852ca5d739decd5296ae8801ed0afc24b7ea7045":"2017-11-29T14:43:22.060Z","2.0.0":"2017-11-29T16:11:16.762Z","3.0.0-beta1":"2017-12-01T15:14:10.351Z","3.0.0-beta2":"2017-12-08T15:01:09.662Z","3.0.0-beta3":"2017-12-15T15:01:07.913Z","3.0.0-be1961c891dd0be4fdb4728385d0f2278580fa33":"2017-12-19T09:40:45.404Z","3.0.0-93065de6d2ea86156a6599824785950036b7a7eb":"2017-12-19T15:07:25.830Z","3.0.0-beta4":"2017-12-22T15:01:18.813Z","3.0.0-beta5":"2017-12-29T15:14:15.505Z","2.1.0-beta1":"2018-01-05T15:01:17.234Z","2.1.0-5f3ac36ee721d7311a2c10b6dec456109bf7f0aa":"2018-01-10T16:40:54.681Z","2.1.0-d231c7a11e7076e3ad9bf1c32aa1b118f3d889a9":"2018-01-12T09:49:47.268Z","2.1.0-0751c5e66735358ac650a9b37270d2a992c658f0":"2018-01-12T13:28:50.597Z","2.1.0-beta2":"2018-01-12T15:01:37.501Z","2.1.0-beta3":"2018-01-19T15:01:35.698Z","2.1.0-2bdd98ac8f7774a7681b4681fb7e5f9310d02d9c":"2018-01-25T15:04:45.646Z","2.1.0-c9b30392b0fb19e24229772d415e97caa9eb1f7e":"2018-01-26T10:24:31.067Z","2.1.0-4c702fe0041642c09f12fb939014cf70671d8ed8":"2018-01-26T11:01:34.563Z","2.1.0-beta4":"2018-01-26T15:01:36.688Z","2.1.0":"2018-01-26T16:45:11.901Z","2.2.0-beta1":"2018-02-02T15:01:45.958Z","2.2.0-c3c28a1c6f84bd15bdabbf5928c97a3d355e6a33":"2018-02-07T16:37:47.535Z","2.2.0-beta2":"2018-02-09T15:01:40.936Z","2.2.0-37ae1528b50160408e0ec1e3f16c9f938a8e97c6":"2018-02-12T13:55:45.608Z","2.2.0-317d2ac38504393b8200e4fe7dced98eb5725b2a":"2018-02-12T14:22:39.328Z","2.2.0-c8f6736c571c52038c46b490892f96616b31662c":"2018-02-13T09:25:43.395Z","2.2.0-beta3":"2018-02-16T15:01:44.010Z","2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f650":"2018-02-23T10:13:15.200Z","2.2.0-beta4":"2018-02-23T15:01:39.547Z","2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f651":"2018-02-23T22:54:39.221Z","2.2.0-8a2c1fb6ee2bda69d7fba46f9498586e81a3f652":"2018-02-23T22:58:17.481Z","2.2.0-4ca81f81cddf377b12b6ff94f0c62af68ab907d1":"2018-02-28T16:46:51.743Z","2.2.0-2562e73970a92cf7b886006c8b545edde98d8d7b":"2018-02-28T16:58:43.786Z","2.2.0-2cda04d780f0317b8cd55a1b511ebb26e33c4152":"2018-02-28T17:07:42.982Z","2.2.0-beta5":"2018-02-28T17:13:03.623Z","2.2.0-ba43bebde72331352731c7fc312737e6cf76efbf":"2018-03-02T14:10:48.275Z","2.2.0-beta6":"2018-03-02T15:01:37.090Z","2.2.0-6d80227ed378f5ae1a55ee5c6bd885285f28bec5":"2018-03-05T11:19:45.810Z","2.2.0-69b54b2f564ed863f5a47355ea0371754fcbb84f":"2018-03-05T11:22:27.715Z","2.2.0":"2018-03-05T14:51:33.475Z","2.3.0-beta1":"2018-03-09T15:01:41.976Z","2.3.0-2b3e3f1fdae61cb0a4a6e7014969565a829f5fd4":"2018-03-09T22:40:45.660Z","2.3.0-bc739247d02401e9678943b98aa63de8cb85a274":"2018-03-12T16:29:27.712Z","2.3.0-beta2":"2018-03-14T15:15:11.964Z","2.3.0-efa7130dee02699999cfdb9e96ddba8763dcc1a8":"2018-03-14T18:18:20.267Z","2.3.0-beta3":"2018-03-15T09:44:40.565Z","2.3.0-24bfd3e92d2c967d0d3a88eb56844c1e8fab85a1":"2018-03-15T09:45:17.983Z","2.3.0-87e54382678b6548e07e1e5664d332f20e77d4bd":"2018-03-15T10:03:17.376Z","2.3.0-bfa4aad6c978c31509336a0a78eb1ec36e8c6862":"2018-03-15T19:54:23.423Z","2.3.0-beta4":"2018-03-16T15:02:39.443Z","2.3.0-7186e9787152f396d8c6c6dc191578ac486a1986":"2018-03-20T19:53:13.599Z","2.3.0-beta5":"2018-03-23T15:02:58.982Z","2.3.0-8f92fd282c67dc4ba5344a0ef7279fb1d5ef0c9f":"2018-03-27T09:32:23.480Z","2.3.0-a8fd3e442a61ccdeb94e562cb9d5e305341b2368":"2018-03-28T11:29:15.475Z","2.3.0-beta6":"2018-03-30T14:03:50.409Z","2.3.0-adc677d28cb4f3a4c4f3668a0fc02da1e8f2714d":"2018-04-04T16:42:03.402Z","2.3.0-11d6bf7c1189ef6a97bc673971de7c3909f10cef":"2018-04-05T09:15:03.843Z","2.3.0-beta7":"2018-04-06T14:02:04.640Z","2.3.0-3f1a4cec6a79f4bb71ae7c0ef962539739662f09":"2018-04-08T15:42:43.443Z","2.3.0-beta8":"2018-04-11T13:09:20.392Z","2.3.0-beta9":"2018-04-13T14:03:32.274Z","2.3.0-beta10":"2018-04-14T15:53:18.086Z","2.3.0-2c74891085ec43fbe7fcfcd1102b388168bedf3d":"2018-04-14T18:26:47.213Z","2.3.0-29e4fee16dda6fbfb7968649d134036e4d55a301":"2018-04-17T11:54:41.511Z","2.3.0-20521af7bbf48e0259bc810f01cdb5b085bc8f19":"2018-04-17T16:39:42.335Z","2.3.0":"2018-04-17T16:48:27.980Z","2.4.0-beta1":"2018-04-20T14:02:40.025Z","2.4.0-a6e823abba12829706f4d3a978f7b5b339817fd6":"2018-04-25T15:51:48.194Z","2.4.0-6aeb75354b9b0ddb74444bfb449549ec21c123de":"2018-04-25T17:30:46.000Z","2.3.1":"2018-04-25T17:43:05.865Z","2.4.0-beta2":"2018-04-27T14:02:42.477Z","2.4.0-eceafaf13e1df3bf2c95e1942952e8806ef9124d":"2018-05-02T09:36:11.034Z","2.4.0-fe62e582941fe26a93267fef9d2ef0f1048d96fc":"2018-05-02T23:30:03.661Z","2.4.0-0136cbeddf740597bf0189c801a3aeb73d51b285":"2018-05-03T13:22:23.316Z","2.4.0-4004714595dcb24619ac8519e04441797985080d":"2018-05-03T16:57:21.227Z","2.4.0-31a7fc6e5d58dc8bf202ef9a80bc993c9f48fe18":"2018-05-03T18:18:16.765Z","2.4.0-beta3":"2018-05-04T14:02:39.249Z","2.4.0-beta4":"2018-05-11T14:02:39.858Z","2.4.0-d25b88191918c265e4b25faac8f58123f81984b3":"2018-05-17T09:40:14.944Z","2.4.0-b63fdfeb4b3f4cd13be763c262969e503f99f533":"2018-05-18T11:34:01.410Z","2.4.0-36aa0a47232b95340577905cf72edab314e5b12b":"2018-05-18T12:24:46.041Z","2.4.0-beta5":"2018-05-18T14:04:42.331Z","2.4.0-45f64c3562cdd091c992926bf496e0e693688f71":"2018-05-18T16:24:49.706Z","2.4.0-2b6c226654d7715ed34dfbd6f9b266adb4d85e00":"2018-05-18T17:35:16.252Z","2.4.0-5c3888062e78285627b1f05b5fca271cc0fc77e4":"2018-05-18T18:12:07.796Z","2.4.0-cbe2d189fafa5fc2c6e9f1b6d370faad9f6dd000":"2018-05-18T23:54:50.486Z","2.4.0-53f0655bb278cd3111eddd2fb141a95f4b957ece":"2018-05-21T11:54:50.032Z","2.4.0-beta6":"2018-05-21T16:37:32.066Z","2.4.0-2dbba5b40321688b340f51a376e9a1114864e658":"2018-05-22T09:30:57.647Z","2.4.0-beta7":"2018-05-25T14:02:40.464Z","2.4.0-beta8":"2018-05-31T15:13:41.603Z","2.4.0-fed4e011ee70eb36b5e2015859e719153d70b6c2":"2018-06-01T09:19:00.564Z","2.4.0-beta9":"2018-06-01T14:03:24.964Z","2.4.0-8ab589fe2e12e0c54c10c4596b036cb544484e21":"2018-06-07T16:29:47.819Z","2.4.0-6dcffbb2ca51d44830bf9c0a20b6c50a448b2837":"2018-06-07T18:05:45.899Z","2.4.0-cab81f4d5e1ca60fa70ce9199e7ff028d43484d7":"2018-06-08T11:03:02.147Z","2.4.0-beta10":"2018-06-08T14:05:15.905Z","2.4.0-beta11":"2018-06-08T15:18:08.062Z","2.4.0-beta12":"2018-06-08T15:22:14.104Z","2.4.0-a8953fea4ccd93a128e90177fc6671df523c2c64":"2018-06-11T15:57:25.199Z","2.4.0-f2be5e0523b1be9bc7e88bd9f00789ea78aca41e":"2018-06-12T11:57:27.785Z","2.4.0-e972f59be4e8f2e6bac1fadd793432e9701d8c06":"2018-06-12T12:00:25.399Z","2.4.0-d78bd47d095d373088d67a4fe2aa3bb06c66c14f":"2018-06-12T15:12:22.763Z","2.4.0-beta13":"2018-06-12T16:58:55.193Z","2.4.0-beta14":"2018-06-15T14:02:49.475Z","2.4.0-b37294bb45b791f7041ba24519bd2986a1031771":"2018-06-19T16:36:25.919Z","2.4.0-c8369a97c208de7a8b0fdb32ca24993bf1ee8e3d":"2018-06-19T21:51:23.219Z","2.4.0-31ede1dc5d8f95d7184c1cf944490883f4982d67":"2018-06-19T22:23:59.603Z","2.4.0-868581f930d784194f0e1f3111d9f16a69b102a6":"2018-06-20T08:00:32.214Z","2.4.0-e4d79dfcb472c8c27b0d32cce4cc43c00ff2371a":"2018-06-20T08:12:30.817Z","2.4.0-1154af15fb6aedf7997241b762020593ab911d3c":"2018-06-20T11:48:33.471Z","2.4.0-2db3d3873eea5f90abbc160d2b4c654ba95c633c":"2018-06-20T13:06:12.198Z","2.4.0-ab3e53e346490fb1b4d8b48c8b75841e7d0927c0":"2018-06-21T14:36:23.865Z","2.4.0-82f31b36c9caa38dbbaea1ec7f01d0879d91587b":"2018-06-21T17:02:55.210Z","2.4.0-8f01b36de0e8b74f5071e86e4753022cb3140ae4":"2018-06-21T20:54:20.673Z","2.4.0-7b4280f696d678984c21f6abbbac1e9c1cb33c24":"2018-06-21T21:08:14.304Z","2.4.0-2cdf2936b16945e97b5efb9b6570b5641911298a":"2018-06-22T12:22:56.677Z","2.4.0-beta15":"2018-06-22T14:03:01.175Z","2.4.0-a86e9ab1b20ea876347b2fa7479d989a446929fc":"2018-06-22T18:15:02.405Z","2.4.0-92eae7db59edeb63e2e0dc1e4c2e6b182ff46f2b":"2018-06-22T18:21:21.363Z","2.4.0":"2018-06-25T10:28:19.181Z","2.5.0-3a53a7c2417f4e004631e5b5c76097cba312a714":"2018-06-29T13:42:26.081Z","2.5.0-beta1":"2018-06-29T14:03:09.976Z","2.5.0-beta2":"2018-07-06T14:02:51.316Z","2.5.0-d5acbab9993711f37b66351a6aaedf6fc72d1ce2":"2018-07-23T16:48:58.220Z","2.5.0-beta3":"2018-08-03T18:53:33.856Z","2.5.0-bafd6cb5b1597a4cd92ff396da63f37cfaad93d3":"2018-08-06T17:00:59.920Z","2.5.0-beta4":"2018-08-07T12:36:34.192Z","2.5.0-b048ff2aad00611aac1c02af531549b60acc0e66":"2018-08-08T13:22:25.827Z","2.5.0-beta5":"2018-08-10T14:03:17.518Z","2.5.0-f524d72a16879f26c210a5e75200a4b9fc9f3bff":"2018-08-10T15:23:24.437Z","2.5.0-2f54e41504a87f5d60c6863ab1ba05744a76b2de":"2018-08-10T19:51:22.185Z","2.5.0-f51389cb83831f10b3a07506cfcd4540af92316c":"2018-08-14T14:41:45.918Z","2.5.0":"2018-08-14T15:55:24.383Z","2.6.0-beta1":"2018-08-17T14:03:48.070Z","2.6.0-beta2":"2018-08-24T14:02:45.619Z","2.6.0-2f8dae2e0477510ee4257b314d720eb176f19e56":"2018-08-29T17:07:26.864Z","2.6.0-beta3":"2018-08-31T14:02:43.794Z","2.6.0-ae3a3622d9474691bf90b1495282076224e36ecf":"2018-09-04T14:47:06.810Z","2.6.0-094fb2feae6a25dba3e4d22ac08678529ea9781e":"2018-09-04T14:53:03.352Z","2.6.0-c87428564306f710159976b0d740a07a94326cf1":"2018-09-04T15:05:10.575Z","2.6.0-beta4":"2018-09-07T14:04:39.333Z","2.6.0-1c0a85da20c8935876a0de499d6557f51cea1d78":"2018-09-12T12:02:18.741Z","2.6.0-e7a6d9d6f4c88b7ff787a43702d77a2221bc4933":"2018-09-12T16:23:14.652Z","2.6.0-48ee903f46585b1f0967311bde867dbe8ea9374d":"2018-09-12T16:28:40.988Z","2.6.0-beta5":"2018-09-14T14:02:38.003Z","2.6.0-e0035744611f12f4f0067495615fa37ce392c810":"2018-09-14T16:56:08.292Z","2.6.0-a2a61de6bcc708eb3bc87de604b58a8749a973fc":"2018-09-18T16:00:15.061Z","2.6.0-6e06c134e4d29ccf8cc3001b330c57ea0571e58b":"2018-09-21T13:57:18.227Z","2.6.0-beta6":"2018-09-21T14:05:06.207Z","2.6.0-f63bc88452735de16bffe08355b42fbbb4263aa0":"2018-09-25T13:55:37.097Z","2.6.0-bb5223c2ddc753153d69deef8310cf79d48f1f48":"2018-09-25T16:27:04.208Z","2.6.0-e899b754b7e0bc99964f87e76a20b73ade631d81":"2018-09-28T10:14:56.101Z","2.6.0-beta7":"2018-09-28T14:02:44.845Z","2.6.0-a777a19bc169173a712c9c69c3669a98066a482c":"2018-10-01T12:05:56.335Z","2.6.0-d3d363c4d25f1148ade6bf21f8b346efd55f4792":"2018-10-04T16:24:06.855Z","2.6.0-ecba2b7165783a3c992a833dea506864c252c5b4":"2018-10-04T16:33:02.027Z","2.6.0-3ead2d4cdc0cb0677782bfc33e7676ddb77d4cef":"2018-10-04T16:35:56.565Z","2.6.0":"2018-10-04T18:30:42.946Z","2.7.0-beta1":"2018-10-05T14:02:57.259Z","2.7.0-beta2":"2018-10-12T14:02:57.461Z","2.7.0-6d1e61de7e274a14eda3fcd30efe30396889b3b0":"2018-10-17T10:59:59.498Z","2.7.0-beta3":"2018-10-19T14:02:54.533Z","2.7.0-beta4":"2018-10-26T14:02:59.428Z","2.7.0-2a84d662e8134ada8923742adad17351a4a2f777":"2018-10-29T16:35:57.962Z","2.7.0-beta5":"2018-11-02T15:10:08.069Z","2.6.1":"2018-11-06T18:04:55.816Z","2.7.0-beta6":"2018-11-09T15:02:40.728Z","2.7.0-beta7":"2018-11-16T15:02:39.784Z","3.0.0-beta6":"2018-11-19T17:03:03.650Z","3.0.0-beta7":"2018-11-23T15:02:45.216Z","3.0.0-14a975b4461542cd2e108addd613a813313d32e8":"2018-12-12T14:53:02.776Z","3.0.0-delta1":"2018-12-21T09:17:45.701Z"},"homepage":"https://github.com/Alfresco/alfresco-js-api#readme","keywords":["alfresco"],"repository":{"type":"git","url":"git+https://github.com/Alfresco/alfresco-js-api.git"},"contributors":[{"name":"Will Abson","email":"will.abson@alfresco.com"},{"name":"Eugenio Romano","email":"eugenio.romano@alfresco.com"},{"name":"Denys Vuika","email":"denys.vuika@gmail.com"},{"name":"Mario Romano","email":"mario.romano83@gmail.com"}],"bugs":{"url":"https://github.com/Alfresco/alfresco-js-api/issues"},"license":"Apache-2.0","readmeFilename":"","author":{"name":"Alfresco Software, Ltd."}}