From 588e706a5202c4326c77d89905352ecf919eb9f4 Mon Sep 17 00:00:00 2001 From: Sebastien Durand <11314079+sebdurand@users.noreply.github.com> Date: Thu, 7 Jun 2018 14:53:10 +0200 Subject: [PATCH 01/13] 1.0.3 (#3) * refactoring : playbackstatus as int * fix reply connection status * fix getMetadata * fix tracks * fix format code --- package-lock.json | 2617 +++++++++++++++++++++++++++-- package.json | 2 +- src/channel/webapp.channel.ts | 2 +- src/media/image.media.ts | 99 +- src/media/media.ts | 386 ++--- src/media/video.media.ts | 454 ++--- src/ocast.ts | 311 ++-- src/type/enum.media.status.ts | 12 +- test/channel.mediachannel.spec.ts | 2 +- 9 files changed, 3198 insertions(+), 687 deletions(-) diff --git a/package-lock.json b/package-lock.json index a99ef5b..9062d2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,309 @@ { "name": "ocast-sdk", - "version": "1.0.4", + "version": "1.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "1.0.1", + "glob-to-regexp": "0.3.0" + } + }, + "@octokit/rest": { + "version": "15.2.6", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-15.2.6.tgz", + "integrity": "sha512-KcqG0zjnjzUqn7wczz/fKiueNpTLiAI7erhUG6bXWAsYKJJlqnwYonFSXrMW/nmes5y+qOk4uSyHBh1mdRXdVQ==", + "dev": true, + "requires": { + "before-after-hook": "1.1.0", + "btoa-lite": "1.0.0", + "debug": "3.1.0", + "http-proxy-agent": "2.1.0", + "https-proxy-agent": "2.2.1", + "lodash": "4.17.5", + "node-fetch": "2.1.2", + "url-template": "2.0.8" + }, + "dependencies": { + "agent-base": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.0.tgz", + "integrity": "sha512-c+R/U5X+2zz2+UCrCFv6odQzJdoqI+YecuhnAJLa1zYaMc13zPfwMwZrr91Pd1DYNo/yPRbiM4WVf9whgwFsIg==", + "dev": true, + "requires": { + "es6-promisify": "5.0.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "https-proxy-agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "dev": true, + "requires": { + "agent-base": "4.2.0", + "debug": "3.1.0" + } + } + } + }, + "@semantic-release/commit-analyzer": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-5.0.3.tgz", + "integrity": "sha512-4GLFDmp8Up+f4GQGPIzLVd8X9a3yqbZjl761sEdfCH4e5FkEO3I9XRlTEfKSueeCt5OA1lZBb9IHGpZ6Ot0+BQ==", + "dev": true, + "requires": { + "conventional-changelog-angular": "3.0.6", + "conventional-commits-parser": "2.1.7", + "debug": "3.1.0", + "import-from": "2.1.0", + "lodash": "4.17.5" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "@semantic-release/error": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-2.2.0.tgz", + "integrity": "sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg==", + "dev": true + }, + "@semantic-release/github": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-4.2.11.tgz", + "integrity": "sha512-iaoHp8sDTgE0dFK4l9UwtjP/GmxHN9r8Hxi8fJNXOtC6tYU8JJqbvQHek4N7flNNbx74Drgga+Sc1eShlhE3Ng==", + "dev": true, + "requires": { + "@octokit/rest": "15.2.6", + "@semantic-release/error": "2.2.0", + "aggregate-error": "1.0.0", + "bottleneck": "2.3.0", + "debug": "3.1.0", + "fs-extra": "5.0.0", + "globby": "8.0.1", + "issue-parser": "1.0.3", + "lodash": "4.17.5", + "mime": "2.3.1", + "p-filter": "1.0.0", + "p-retry": "1.0.0", + "parse-github-url": "1.0.2", + "url-join": "4.0.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "fs-extra": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", + "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "4.0.0", + "universalify": "0.1.1" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "mime": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", + "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==", + "dev": true + } + } + }, + "@semantic-release/npm": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-3.2.4.tgz", + "integrity": "sha512-Kkl5nwRGw0yRg6B4qr8LIi+BkcdK3tJ67ziTzo65SZLEpuV8NLVsm7OAiOMK34rOL3Utkno+BA3AGTg7fhm/nw==", + "dev": true, + "requires": { + "@semantic-release/error": "2.2.0", + "aggregate-error": "1.0.0", + "execa": "0.10.0", + "fs-extra": "5.0.0", + "lodash": "4.17.5", + "nerf-dart": "1.0.0", + "normalize-url": "2.0.1", + "read-pkg": "3.0.0", + "registry-auth-token": "3.3.2" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "1.0.4", + "path-key": "2.0.1", + "semver": "5.5.0", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "dev": true, + "requires": { + "cross-spawn": "6.0.5", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "fs-extra": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", + "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "4.0.0", + "universalify": "0.1.1" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "4.0.0", + "normalize-package-data": "2.4.0", + "path-type": "3.0.0" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "@semantic-release/release-notes-generator": { + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-6.0.9.tgz", + "integrity": "sha512-qK9d4m4QoK5kqZ/QU0hwDIdaIj0FttsActLAAH87FrqJYJZCikMrgrpzkLM8YFpgi6MZCew9YirGVrwvmxXUVg==", + "dev": true, + "requires": { + "conventional-changelog-angular": "3.0.6", + "conventional-changelog-writer": "3.0.9", + "conventional-commits-parser": "2.1.7", + "debug": "3.1.0", + "get-stream": "3.0.0", + "git-url-parse": "8.3.1", + "import-from": "2.1.0", + "into-stream": "3.1.0", + "lodash": "4.17.5" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, "@types/chai": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.2.tgz", @@ -106,6 +406,16 @@ "@types/node": "8.9.4" } }, + "JSONStream": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", + "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -136,6 +446,24 @@ } } }, + "aggregate-error": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-1.0.0.tgz", + "integrity": "sha1-iINE2tAiCnLjr1CQYRf0h3GSX6w=", + "dev": true, + "requires": { + "clean-stack": "1.3.0", + "indent-string": "3.2.0" + }, + "dependencies": { + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + } + } + }, "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", @@ -162,6 +490,12 @@ "string-width": "2.1.1" } }, + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, "ansi-gray": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", @@ -189,6 +523,12 @@ "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", "dev": true }, + "ansicolors": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz", + "integrity": "sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8=", + "dev": true + }, "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", @@ -296,6 +636,12 @@ "sprintf-js": "1.0.3" } }, + "argv-formatter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/argv-formatter/-/argv-formatter-1.0.0.tgz", + "integrity": "sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk=", + "dev": true + }, "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", @@ -332,12 +678,27 @@ "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, + "array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", + "dev": true + }, "array-slice": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", "dev": true }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", @@ -1011,6 +1372,12 @@ "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", "dev": true }, + "before-after-hook": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-1.1.0.tgz", + "integrity": "sha512-VOMDtYPwLbIncTxNoSzRyvaMxtXmLWLUqr8k5AfC1BzLk34HvBXaQX8snOwQZ4c0aX8aSERqtJSiI9/m2u5kuA==", + "dev": true + }, "binary-extensions": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", @@ -1073,6 +1440,12 @@ "hoek": "0.9.1" } }, + "bottleneck": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.3.0.tgz", + "integrity": "sha512-Zxhe8FRIiFp5/uGRxIt/s26f6bm0Z87BWzPbUUZZGLkXOldRse1I/pqASYKjcth+6D1NOpVjaqD1X6aEqH+GCw==", + "dev": true + }, "boxen": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", @@ -1202,6 +1575,12 @@ "https-proxy-agent": "1.0.0" } }, + "btoa-lite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", + "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", + "dev": true + }, "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -1292,6 +1671,21 @@ "unset-value": "1.0.0" } }, + "cachedir": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-1.2.0.tgz", + "integrity": "sha512-i3xIKd9U4ov0hWXYo08oJy0YVz0krZ9dbTZQim41xkg0IiScptkAK0UilZ5M1WE3gnWjXAa9+cMtrJ5dM+THbA==", + "dev": true, + "requires": { + "os-homedir": "1.0.2" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, "camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", @@ -1322,6 +1716,16 @@ "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", "dev": true }, + "cardinal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-1.0.0.tgz", + "integrity": "sha1-UOIcGwqjdyn5N33vGWtanOyTLuk=", + "dev": true, + "requires": { + "ansicolors": "0.2.1", + "redeyed": "1.0.1" + } + }, "caseless": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.8.0.tgz", @@ -1495,12 +1899,50 @@ } } }, + "clean-stack": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-1.3.0.tgz", + "integrity": "sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=", + "dev": true + }, "cli-boxes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", "dev": true }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "cli-table": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz", + "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=", + "dev": true, + "requires": { + "colors": "1.0.3" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + } + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, "cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", @@ -1540,6 +1982,12 @@ "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=", "dev": true }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -1595,8 +2043,125 @@ "graceful-readlink": "1.0.1" } }, - "component-emitter": { - "version": "1.2.1", + "commitizen": { + "version": "2.9.6", + "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-2.9.6.tgz", + "integrity": "sha1-wNAFNe8mTaf2Nzft/aQiiYP6IpE=", + "dev": true, + "requires": { + "cachedir": "1.2.0", + "chalk": "1.1.3", + "cz-conventional-changelog": "1.2.0", + "dedent": "0.6.0", + "detect-indent": "4.0.0", + "find-node-modules": "1.0.4", + "find-root": "1.0.0", + "fs-extra": "1.0.0", + "glob": "7.1.1", + "inquirer": "1.2.3", + "lodash": "4.17.2", + "minimist": "1.2.0", + "path-exists": "2.1.0", + "shelljs": "0.7.6", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "cz-conventional-changelog": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-1.2.0.tgz", + "integrity": "sha1-K8oElkyJGbI/P9aonvXmAIsxs/g=", + "dev": true, + "requires": { + "conventional-commit-types": "2.2.0", + "lodash.map": "4.6.0", + "longest": "1.0.1", + "pad-right": "0.2.2", + "right-pad": "1.0.1", + "word-wrap": "1.2.3" + } + }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1" + } + }, + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "lodash": { + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.2.tgz", + "integrity": "sha1-NKMFW6vgTOQkZ7YH1wAHLH/2v0I=", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "shelljs": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.6.tgz", + "integrity": "sha1-N5zM+1a5HIYB5HkzVutTgpJN6a0=", + "dev": true, + "requires": { + "glob": "7.1.1", + "interpret": "1.1.0", + "rechoir": "0.6.2" + } + } + } + }, + "compare-func": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", + "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", + "dev": true, + "requires": { + "array-ify": "1.0.0", + "dot-prop": "3.0.0" + }, + "dependencies": { + "dot-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", + "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", + "dev": true, + "requires": { + "is-obj": "1.0.1" + } + } + } + }, + "component-emitter": { + "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", "dev": true @@ -1676,6 +2241,375 @@ "utils-merge": "1.0.1" } }, + "conventional-changelog-angular": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-3.0.6.tgz", + "integrity": "sha512-jWuwQEOn/jcPZ5ZQbAlKnrMAW00uT8BTac/ex1S2lDhqg5D4Qr3rGzyGmK/ZCSmVopE9BOcFkt3+ubEGqfpT9w==", + "dev": true, + "requires": { + "compare-func": "1.3.2", + "q": "1.5.1" + } + }, + "conventional-changelog-writer": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-3.0.9.tgz", + "integrity": "sha512-n9KbsxlJxRQsUnK6wIBRnARacvNnN4C/nxnxCkH+B/R1JS2Fa+DiP1dU4I59mEDEjgnFaN2+9wr1P1s7GYB5/Q==", + "dev": true, + "requires": { + "compare-func": "1.3.2", + "conventional-commits-filter": "1.1.6", + "dateformat": "3.0.3", + "handlebars": "4.0.11", + "json-stringify-safe": "5.0.1", + "lodash": "4.17.5", + "meow": "4.0.0", + "semver": "5.5.0", + "split": "1.0.1", + "through2": "2.0.3" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "4.1.0", + "map-obj": "2.0.0", + "quick-lru": "1.1.0" + } + }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.0.tgz", + "integrity": "sha512-Me/kel335m6vMKmEmA6c87Z6DUFW3JqkINRnxkbC+A/PUm0D5Fl2dEBQrPKnqCL9Te/CIa1MUt/0InMJhuC/sw==", + "dev": true, + "requires": { + "camelcase-keys": "4.2.0", + "decamelize-keys": "1.1.0", + "loud-rejection": "1.6.0", + "minimist": "1.2.0", + "minimist-options": "3.0.2", + "normalize-package-data": "2.4.0", + "read-pkg-up": "3.0.0", + "redent": "2.0.0", + "trim-newlines": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "4.0.0", + "normalize-package-data": "2.4.0", + "path-type": "3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "3.0.0" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "3.2.0", + "strip-indent": "2.0.0" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + } + } + }, + "conventional-commit-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz", + "integrity": "sha1-XblXOdbCEqy+e29lahG5QLqmiUY=", + "dev": true + }, + "conventional-commits-filter": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-1.1.6.tgz", + "integrity": "sha512-KcDgtCRKJCQhyk6VLT7zR+ZOyCnerfemE/CsR3iQpzRRFbLEs0Y6rwk3mpDvtOh04X223z+1xyJ582Stfct/0Q==", + "dev": true, + "requires": { + "is-subset": "0.1.1", + "modify-values": "1.0.1" + } + }, + "conventional-commits-parser": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz", + "integrity": "sha512-BoMaddIEJ6B4QVMSDu9IkVImlGOSGA1I2BQyOZHeLQ6qVOJLcLKn97+fL6dGbzWEiqDzfH4OkcveULmeq2MHFQ==", + "dev": true, + "requires": { + "JSONStream": "1.3.2", + "is-text-path": "1.0.1", + "lodash": "4.17.5", + "meow": "4.0.0", + "split2": "2.2.0", + "through2": "2.0.3", + "trim-off-newlines": "1.0.1" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "4.1.0", + "map-obj": "2.0.0", + "quick-lru": "1.1.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.0.tgz", + "integrity": "sha512-Me/kel335m6vMKmEmA6c87Z6DUFW3JqkINRnxkbC+A/PUm0D5Fl2dEBQrPKnqCL9Te/CIa1MUt/0InMJhuC/sw==", + "dev": true, + "requires": { + "camelcase-keys": "4.2.0", + "decamelize-keys": "1.1.0", + "loud-rejection": "1.6.0", + "minimist": "1.2.0", + "minimist-options": "3.0.2", + "normalize-package-data": "2.4.0", + "read-pkg-up": "3.0.0", + "redent": "2.0.0", + "trim-newlines": "2.0.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "4.0.0", + "normalize-package-data": "2.4.0", + "path-type": "3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "3.0.0" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "3.2.0", + "strip-indent": "2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + } + } + }, "convert-source-map": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", @@ -1700,6 +2634,30 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "cosmiconfig": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-4.0.0.tgz", + "integrity": "sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ==", + "dev": true, + "requires": { + "is-directory": "0.3.1", + "js-yaml": "3.11.0", + "parse-json": "4.0.0", + "require-from-string": "2.0.2" + }, + "dependencies": { + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + } + } + }, "create-error-class": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", @@ -1762,6 +2720,19 @@ "array-find-index": "1.0.2" } }, + "cz-conventional-changelog": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-2.1.0.tgz", + "integrity": "sha1-L0vHOQ4yROTfKT5ro1Hkx0Cnx2Q=", + "dev": true, + "requires": { + "conventional-commit-types": "2.2.0", + "lodash.map": "4.6.0", + "longest": "1.0.1", + "right-pad": "1.0.1", + "word-wrap": "1.2.3" + } + }, "dateformat": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", @@ -1783,6 +2754,16 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "1.2.0", + "map-obj": "1.0.1" + } + }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", @@ -2250,6 +3231,12 @@ } } }, + "dedent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.6.0.tgz", + "integrity": "sha1-Dm2o8M5Sg471zsXI+TlrDBtko8s=", + "dev": true + }, "deep-eql": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", @@ -2343,6 +3330,33 @@ "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", "dev": true }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "path-type": "3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", @@ -2984,13 +3998,74 @@ } } }, + "env-ci": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-1.6.0.tgz", + "integrity": "sha512-DK9wJ1s498dBW4fn8kPcGzD5QpQSCtm3tw8UgjNdhiGTvQ3PR7/WeCXHx4pltGPi2x8Wlk5s5/BNshM7aDK8XA==", + "dev": true, + "requires": { + "execa": "0.10.0", + "java-properties": "0.2.10" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "1.0.4", + "path-key": "2.0.1", + "semver": "5.5.0", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "dev": true, + "requires": { + "cross-spawn": "6.0.5", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + } + } + }, "error-ex": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "0.2.1" + } + }, + "es6-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "4.2.4" } }, "escape-html": { @@ -3063,6 +4138,12 @@ "strip-eof": "1.0.0" } }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -3239,6 +4320,17 @@ } } }, + "external-editor": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-1.1.1.tgz", + "integrity": "sha1-Etew24UPf/fnCBuvQAVwAGDEYAs=", + "dev": true, + "requires": { + "extend": "3.0.1", + "spawn-sync": "1.0.15", + "tmp": "0.0.29" + } + }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -3286,6 +4378,30 @@ "time-stamp": "1.1.0" } }, + "fast-glob": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.0.tgz", + "integrity": "sha512-4F75PTznkNtSKs2pbhtBwRkw8sRwa7LfXx5XaQJOe4IQ6yTjceLDTwM5gj1s80R2t/5WeDC1gVfm3jLE+l39Tw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "2.2.1", + "glob-parent": "3.1.0", + "is-glob": "4.0.0", + "merge2": "1.2.1", + "micromatch": "3.1.9" + }, + "dependencies": { + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + } + } + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -3301,6 +4417,24 @@ "pend": "1.2.0" } }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, "file-type": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", @@ -3357,6 +4491,172 @@ "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=", "dev": true }, + "find-node-modules": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-1.0.4.tgz", + "integrity": "sha1-tt6zzMtpnIcDdne87eLF9YYrJVA=", + "dev": true, + "requires": { + "findup-sync": "0.4.2", + "merge": "1.2.0" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "detect-file": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", + "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", + "dev": true, + "requires": { + "fs-exists-sync": "0.1.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-tilde": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", + "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", + "dev": true, + "requires": { + "os-homedir": "1.0.2" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "findup-sync": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.2.tgz", + "integrity": "sha1-qBF9D3MST1pFRoOVef5S1xKfteU=", + "dev": true, + "requires": { + "detect-file": "0.1.0", + "is-glob": "2.0.1", + "micromatch": "2.3.11", + "resolve-dir": "0.1.1" + } + }, + "global-modules": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", + "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "dev": true, + "requires": { + "global-prefix": "0.1.5", + "is-windows": "0.2.0" + } + }, + "global-prefix": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", + "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "dev": true, + "requires": { + "homedir-polyfill": "1.0.1", + "ini": "1.3.5", + "is-windows": "0.2.0", + "which": "1.3.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-windows": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", + "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "resolve-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", + "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", + "dev": true, + "requires": { + "expand-tilde": "1.2.2", + "global-modules": "0.2.3" + } + } + } + }, + "find-root": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.0.0.tgz", + "integrity": "sha1-li/yEaqyXGUg/u641ih/j26VgHo=", + "dev": true + }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", @@ -3468,6 +4768,54 @@ "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "dev": true }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", + "dev": true + }, "fs-extra": { "version": "0.26.7", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", @@ -4525,6 +5873,12 @@ "globule": "0.1.0" } }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, "get-port": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/get-port/-/get-port-2.1.0.tgz", @@ -4552,6 +5906,51 @@ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, + "git-log-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", + "integrity": "sha1-LmpMGxP8AAKCB7p5WnrDFme5/Uo=", + "dev": true, + "requires": { + "argv-formatter": "1.0.0", + "spawn-error-forwarder": "1.0.0", + "split2": "1.0.0", + "stream-combiner2": "1.1.1", + "through2": "2.0.3", + "traverse": "0.6.6" + }, + "dependencies": { + "split2": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", + "integrity": "sha1-UuLiIdiMdfmnP5BVbiY/+WdysxQ=", + "dev": true, + "requires": { + "through2": "2.0.3" + } + } + } + }, + "git-up": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/git-up/-/git-up-2.0.10.tgz", + "integrity": "sha512-2v4UN3qV2RGypD9QpmUjpk+4+RlYpW8GFuiZqQnKmvei08HsFPd0RfbDvEhnE4wBvnYs8ORVtYpOFuuCEmBVBw==", + "dev": true, + "requires": { + "is-ssh": "1.3.0", + "parse-url": "1.3.11" + } + }, + "git-url-parse": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-8.3.1.tgz", + "integrity": "sha512-r/FxXIdfgdSO+V2zl4ZK1JGYkHT9nqVRSzom5WsYPLg3XzeBeKPl3R/6X9E9ZJRx/sE/dXwXtfl+Zp7YL8ktWQ==", + "dev": true, + "requires": { + "git-up": "2.0.10", + "parse-domain": "2.0.0" + } + }, "glob": { "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", @@ -4670,6 +6069,12 @@ } } }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, "glob-watcher": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", @@ -4727,6 +6132,43 @@ "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, + "globby": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "1.0.2", + "dir-glob": "2.0.0", + "fast-glob": "2.2.0", + "glob": "7.1.2", + "ignore": "3.3.7", + "pify": "3.0.0", + "slash": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "globule": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", @@ -5069,6 +6511,12 @@ "parse-passwd": "1.0.0" } }, + "hook-std": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-0.4.0.tgz", + "integrity": "sha1-+osvhNNYdjE3y30X4zCLKHFL0XQ=", + "dev": true + }, "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", @@ -5095,6 +6543,36 @@ } } }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "dev": true, + "requires": { + "agent-base": "4.2.0", + "debug": "3.1.0" + }, + "dependencies": { + "agent-base": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.0.tgz", + "integrity": "sha512-c+R/U5X+2zz2+UCrCFv6odQzJdoqI+YecuhnAJLa1zYaMc13zPfwMwZrr91Pd1DYNo/yPRbiM4WVf9whgwFsIg==", + "dev": true, + "requires": { + "es6-promisify": "5.0.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, "http-signature": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", @@ -5117,6 +6595,29 @@ "extend": "3.0.1" } }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "import-from": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", + "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=", + "dev": true, + "requires": { + "resolve-from": "3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -5160,12 +6661,66 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, + "inquirer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-1.2.3.tgz", + "integrity": "sha1-TexvMvN+97sLLtPx0aXD9UUHSRg=", + "dev": true, + "requires": { + "ansi-escapes": "1.4.0", + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-width": "2.2.0", + "external-editor": "1.1.1", + "figures": "1.7.0", + "lodash": "4.17.5", + "mute-stream": "0.0.6", + "pinkie-promise": "2.0.1", + "run-async": "2.3.0", + "rx": "4.1.0", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "through": "2.3.8" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, "interpret": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", "dev": true }, + "into-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", + "dev": true, + "requires": { + "from2": "2.3.0", + "p-is-promise": "1.1.0" + } + }, "invariant": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.3.tgz", @@ -5175,6 +6730,12 @@ "loose-envify": "1.3.1" } }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -5286,6 +6847,12 @@ } } }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", @@ -5421,6 +6988,12 @@ "path-is-inside": "1.0.2" } }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -5442,6 +7015,12 @@ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, "is-redirect": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", @@ -5463,18 +7042,42 @@ "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", "dev": true }, + "is-ssh": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.0.tgz", + "integrity": "sha1-6+oRaaJhTaOSpjdANmw84EnY3/Y=", + "dev": true, + "requires": { + "protocols": "1.4.6" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-subset": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", + "integrity": "sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY=", + "dev": true + }, "is-tar": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-tar/-/is-tar-1.0.0.tgz", "integrity": "sha1-L2suF5LB9bs2UZrKqdZcDSb+hT0=", "dev": true }, + "is-text-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", + "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", + "dev": true, + "requires": { + "text-extensions": "1.7.0" + } + }, "is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", @@ -5532,6 +7135,15 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, + "issue-parser": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-1.0.3.tgz", + "integrity": "sha512-jJeDfplV9Y3ZQIKodmu1aB8X8oNusb8PCL6iK9Z0umJWnmvvu1NJZ2aWitJlEmYOdJOLhcKcFirDX6z/nECNvQ==", + "dev": true, + "requires": { + "lodash": "4.17.5" + } + }, "istanbul": { "version": "0.4.5", "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", @@ -5571,6 +7183,12 @@ } } }, + "java-properties": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-0.2.10.tgz", + "integrity": "sha512-CpKJh9VRNhS+XqZtg1UMejETGEiqwCGDC/uwPEEQwc2nfdbSm73SIE29TplG2gLYuBOOTNDqxzG6A9NtEPLt0w==", + "dev": true + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -5638,6 +7256,12 @@ "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", @@ -5680,6 +7304,12 @@ "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", "dev": true }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -5780,6 +7410,15 @@ } } }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "1.0.0" + } + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -5830,6 +7469,24 @@ } } }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, "lodash": { "version": "4.17.5", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", @@ -5906,6 +7563,12 @@ "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", "dev": true }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "dev": true + }, "lodash.create": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", @@ -5955,6 +7618,12 @@ "lodash.isarray": "3.0.4" } }, + "lodash.map": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=", + "dev": true + }, "lodash.restparam": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", @@ -5988,6 +7657,12 @@ "lodash.escape": "3.2.0" } }, + "lodash.toarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", + "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", + "dev": true + }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -6137,6 +7812,28 @@ "integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==", "dev": true }, + "marked-terminal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-2.0.0.tgz", + "integrity": "sha1-Xq9Wi+ZvaGVBr6UqVYKAMQox3i0=", + "dev": true, + "requires": { + "cardinal": "1.0.0", + "chalk": "1.1.3", + "cli-table": "0.3.1", + "lodash.assign": "4.2.0", + "node-emoji": "1.8.1" + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, "meow": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/meow/-/meow-2.1.0.tgz", @@ -6193,6 +7890,12 @@ } } }, + "merge": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", + "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", + "dev": true + }, "merge-stream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", @@ -6234,6 +7937,12 @@ } } }, + "merge2": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.1.tgz", + "integrity": "sha512-wUqcG5pxrAcaFI1lkqkMnk3Q7nUxV/NWfpAFSeWUwG9TRODnBDCUHa75mi3o3vLWQ5N4CQERWCauSlP0I3ZqUg==", + "dev": true + }, "micromatch": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.9.tgz", @@ -6281,6 +7990,12 @@ "integrity": "sha1-mVrhOSq4r/y/yyZB3QVOlDwNXc4=", "dev": true }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -6296,6 +8011,16 @@ "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "is-plain-obj": "1.1.0" + } + }, "mixin-deep": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", @@ -6393,6 +8118,12 @@ } } }, + "modify-values": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -6408,6 +8139,12 @@ "duplexer2": "0.0.2" } }, + "mute-stream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.6.tgz", + "integrity": "sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s=", + "dev": true + }, "nan": { "version": "2.9.2", "resolved": "https://registry.npmjs.org/nan/-/nan-2.9.2.tgz", @@ -6449,6 +8186,18 @@ "integrity": "sha512-8eRaxn8u/4wN8tGkhlc2cgwwvOLMLUMUn4IYTexMgWd+LyUDfeXVkk2ygQR0hvIHbJQXgHujia3ieUUDwNGkEA==", "dev": true }, + "nerf-dart": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/nerf-dart/-/nerf-dart-1.0.0.tgz", + "integrity": "sha1-5tq3/r9a2Bbqgc9cYpxaDr3nLBo=", + "dev": true + }, + "nice-try": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", + "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "dev": true + }, "node-browser": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/node-browser/-/node-browser-0.0.3.tgz", @@ -6482,6 +8231,21 @@ } } }, + "node-emoji": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.8.1.tgz", + "integrity": "sha512-+ktMAh1Jwas+TnGodfCfjUbJKoANqPaJFN0z0iqh41eqD8dvguNzcitVSBSVK1pidz0AqGbLKcoVuVLRVZ/aVg==", + "dev": true, + "requires": { + "lodash.toarray": "4.4.0" + } + }, + "node-fetch": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", + "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=", + "dev": true + }, "node-ssdp": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/node-ssdp/-/node-ssdp-2.9.1.tgz", @@ -6522,6 +8286,25 @@ "remove-trailing-separator": "1.1.0" } }, + "normalize-url": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", + "dev": true, + "requires": { + "prepend-http": "2.0.0", + "query-string": "5.1.1", + "sort-keys": "2.0.0" + }, + "dependencies": { + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + } + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -8641,18 +10424,95 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "dev": true + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "p-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-1.0.0.tgz", + "integrity": "sha1-Yp0xcVAgnI/VCLoTdxPvS7kg6ds=", + "dev": true, + "requires": { + "p-map": "1.2.0" + } + }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "dev": true + }, + "p-limit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.2.0" + } + }, + "p-map": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", + "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", + "dev": true + }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", + "dev": true + }, + "p-retry": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-1.0.0.tgz", + "integrity": "sha1-OSczKkt9cCabU1UVEX/FR9oaaWg=", + "dev": true, + "requires": { + "retry": "0.10.1" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "package-json": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", @@ -8673,6 +10533,21 @@ } } }, + "pad-right": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", + "integrity": "sha1-b7ySQEXSRPKiokRQMGDTv8YAl3Q=", + "dev": true, + "requires": { + "repeat-string": "1.6.1" + } + }, + "parse-domain": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-domain/-/parse-domain-2.0.0.tgz", + "integrity": "sha512-09LkZIoBmYFj5Ty0oO1cjevbc42/knoiWURPUgKjJHlnK+75KDaF8+DNyEM5IYozO4Ssh6mNVOhrAKRWrwZbqQ==", + "dev": true + }, "parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", @@ -8684,6 +10559,12 @@ "path-root": "0.1.1" } }, + "parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "dev": true + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -8728,6 +10609,16 @@ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", "dev": true }, + "parse-url": { + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-1.3.11.tgz", + "integrity": "sha1-V8FUKKuKiSsfQ4aWRccR0OFEtVQ=", + "dev": true, + "requires": { + "is-ssh": "1.3.0", + "protocols": "1.4.6" + } + }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", @@ -8903,6 +10794,12 @@ "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", "dev": true }, + "protocols": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.6.tgz", + "integrity": "sha1-+LsmPqG1/Xp2BNJri+Ob13Z4v4o=", + "dev": true + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -8921,10 +10818,35 @@ "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", "dev": true }, - "qs": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", - "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", + "qs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", + "dev": true + }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "0.2.0", + "object-assign": "4.1.1", + "strict-uri-encode": "1.1.0" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", "dev": true }, "randomatic": { @@ -9112,6 +11034,23 @@ "strip-indent": "1.0.1" } }, + "redeyed": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-1.0.1.tgz", + "integrity": "sha1-6WwZO0DAgWsArshCaY5hGF5VSYo=", + "dev": true, + "requires": { + "esprima": "3.0.0" + }, + "dependencies": { + "esprima": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.0.0.tgz", + "integrity": "sha1-U88kes2ncxPlUcOqLnM0LT+099k=", + "dev": true + } + } + }, "regenerate": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", @@ -9337,6 +11276,24 @@ } } }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, "require-relative": { "version": "0.8.7", "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", @@ -9379,18 +11336,40 @@ "global-modules": "1.0.0" } }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", + "dev": true + }, "right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -9401,6 +11380,12 @@ "align-text": "0.1.4" } }, + "right-pad": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/right-pad/-/right-pad-1.0.1.tgz", + "integrity": "sha1-jKCMLLtbVedNr6lr9/0aJ9VoyNA=", + "dev": true + }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", @@ -9808,138 +11793,391 @@ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "1.1.0" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "estree-walker": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz", + "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "rollup-pluginutils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz", + "integrity": "sha1-fslbNXP2VDpGpkYb2afFRFJdD8A=", + "dev": true, + "requires": { + "estree-walker": "0.3.1", + "micromatch": "2.3.11" + } + } + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", + "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", + "dev": true + }, + "rxjs": { + "version": "5.5.6", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.6.tgz", + "integrity": "sha512-v4Q5HDC0FHAQ7zcBX7T2IL6O5ltl1a2GX4ENjPXg6SjDY69Cmx9v4113C99a4wGF16ClPv5Z8mghuYorVkg/kg==", + "dev": true, + "requires": { + "symbol-observable": "1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, + "seek-bzip": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", + "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", + "dev": true, + "requires": { + "commander": "2.8.1" + }, + "dependencies": { + "commander": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + "dev": true, + "requires": { + "graceful-readlink": "1.0.1" + } + } + } + }, + "semantic-release": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-15.1.6.tgz", + "integrity": "sha512-l9q8aOPfNm/ioUTzUKj5hhsed8S5o10/YWHWkfoN7QghMmgg1GD3YD3efYCk9EzztS/K1yxRqBlaxhHJCAWzUQ==", + "dev": true, + "requires": { + "@semantic-release/commit-analyzer": "5.0.3", + "@semantic-release/error": "2.2.0", + "@semantic-release/github": "4.2.11", + "@semantic-release/npm": "3.2.4", + "@semantic-release/release-notes-generator": "6.0.9", + "aggregate-error": "1.0.0", + "chalk": "2.3.2", + "cosmiconfig": "4.0.0", + "debug": "3.1.0", + "env-ci": "1.6.0", + "execa": "0.10.0", + "get-stream": "3.0.0", + "git-log-parser": "1.2.0", + "git-url-parse": "8.3.1", + "hook-std": "0.4.0", + "hosted-git-info": "2.6.0", + "lodash": "4.17.5", + "marked": "0.3.17", + "marked-terminal": "2.0.0", + "p-locate": "2.0.0", + "p-reduce": "1.0.0", + "read-pkg-up": "3.0.0", + "resolve-from": "4.0.0", + "semver": "5.5.0", + "yargs": "11.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } + }, + "cliui": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.0.0.tgz", + "integrity": "sha512-nY3W5Gu2racvdDk//ELReY+dHjb9PlIcVDFXP72nVIhq2Gy3LuVXYwJoPVudwQnv1shtohpgkdCKT2YaKY0CKw==", + "dev": true, + "requires": { + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "1.0.4", + "path-key": "2.0.1", + "semver": "5.5.0", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "dev": true, + "requires": { + "cross-spawn": "6.0.5", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" } }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "hosted-git-info": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" } }, - "estree-walker": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz", - "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=", - "dev": true - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" } }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "requires": { - "is-extglob": "1.0.0" + "pify": "3.0.0" } }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "load-json-file": "4.0.0", + "normalize-package-data": "2.4.0", + "path-type": "3.0.0" } }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "find-up": "2.1.0", + "read-pkg": "3.0.0" } }, - "rollup-pluginutils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz", - "integrity": "sha1-fslbNXP2VDpGpkYb2afFRFJdD8A=", + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "estree-walker": "0.3.1", - "micromatch": "2.3.11" + "ansi-regex": "3.0.0" } - } - } - }, - "rxjs": { - "version": "5.5.6", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.6.tgz", - "integrity": "sha512-v4Q5HDC0FHAQ7zcBX7T2IL6O5ltl1a2GX4ENjPXg6SjDY69Cmx9v4113C99a4wGF16ClPv5Z8mghuYorVkg/kg==", - "dev": true, - "requires": { - "symbol-observable": "1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "0.1.15" - } - }, - "seek-bzip": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", - "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", - "dev": true, - "requires": { - "commander": "2.8.1" - }, - "dependencies": { - "commander": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "graceful-readlink": "1.0.1" + "has-flag": "3.0.0" + } + }, + "yargs": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", + "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", + "dev": true, + "requires": { + "cliui": "4.0.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "9.0.2" } } } @@ -10014,6 +12252,12 @@ "send": "0.16.2" } }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, "set-getter": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/set-getter/-/set-getter-0.1.0.tgz", @@ -10257,6 +12501,15 @@ "hoek": "0.9.1" } }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "dev": true, + "requires": { + "is-plain-obj": "1.1.0" + } + }, "source-map": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", @@ -10309,6 +12562,22 @@ "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", "dev": true }, + "spawn-error-forwarder": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz", + "integrity": "sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk=", + "dev": true + }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "dev": true, + "requires": { + "concat-stream": "1.6.1", + "os-shim": "0.1.3" + } + }, "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", @@ -10341,6 +12610,15 @@ "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -10350,6 +12628,15 @@ "extend-shallow": "3.0.2" } }, + "split2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "dev": true, + "requires": { + "through2": "2.0.3" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -10519,6 +12806,12 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -10745,6 +13038,12 @@ "execa": "0.7.0" } }, + "text-extensions": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.7.0.tgz", + "integrity": "sha512-AKXZeDq230UaSzaO5s3qQUZOaC7iKbzq0jOFL614R7d9R593HLqAOL0cYoqLdkNrjBSOdmoQI06yigq1TSBXAg==", + "dev": true + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -10830,6 +13129,15 @@ "integrity": "sha1-yWih5VWa2VUyJO92J7qzTjyu+Kg=", "dev": true }, + "tmp": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", + "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, "to-absolute-glob": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", @@ -10916,12 +13224,24 @@ } } }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", + "dev": true + }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", "dev": true }, + "trim-off-newlines": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "dev": true + }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -11420,6 +13740,12 @@ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, + "url-join": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.0.tgz", + "integrity": "sha1-TTNA6AfTdzvamZH4MFrNzCpmXSo=", + "dev": true + }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", @@ -11438,6 +13764,12 @@ "ip-regex": "1.0.3" } }, + "url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=", + "dev": true + }, "use": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/use/-/use-2.0.2.tgz", @@ -11723,6 +14055,12 @@ "isexe": "2.0.0" } }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, "widest-line": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", @@ -11739,12 +14077,50 @@ "dev": true, "optional": true }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, "wrap-fn": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/wrap-fn/-/wrap-fn-0.1.5.tgz", @@ -11811,6 +14187,12 @@ "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", @@ -11830,6 +14212,23 @@ "window-size": "0.1.0" } }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + }, "yauzl": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.9.1.tgz", diff --git a/package.json b/package.json index 8dc6713..a01ca29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ocast-sdk", - "version": "1.0.2", + "version": "1.0.3", "engines": { "node": ">=8.6.0" }, diff --git a/src/channel/webapp.channel.ts b/src/channel/webapp.channel.ts index 5444131..2e0f373 100644 --- a/src/channel/webapp.channel.ts +++ b/src/channel/webapp.channel.ts @@ -37,7 +37,7 @@ export class WebappChannel extends Channel { * @type {{CONNECTION_STATUS: string}} */ protected static EVENTS: any = { - CONNECTION_STATUS: "connectionStatus", + CONNECTION_STATUS: "connectedStatus", }; /** diff --git a/src/media/image.media.ts b/src/media/image.media.ts index 261b803..f499c20 100644 --- a/src/media/image.media.ts +++ b/src/media/image.media.ts @@ -14,46 +14,77 @@ * limitations under the License. */ -import {ImagePlaybackStatus} from "../media/image.playback.status"; -import {PlaybackStatus} from "../protocol/playback.status"; -import {EnumMediaStatus} from "../type/enum.media.status"; -import {Media} from "./media"; +import { ImagePlaybackStatus } from "../media/image.playback.status"; +import { Metadata } from "../protocol/metadata"; +import { PlaybackStatus } from "../protocol/playback.status"; +import { EnumMedia } from "../type/enum.media"; +import { EnumMediaStatus } from "../type/enum.media.status"; +import { EnumTransferMode } from "../type/enum.transfermode"; +import { Media } from "./media"; /** * Media Controller for Images */ export class ImageMedia extends Media { + /** + * Return get playback Status + * @returns {PlaybackStatus} - Play back Status + */ + public getPlaybackStatus(): PlaybackStatus { + // TODO: Adapt PlaybackStatus for Images ? + return new ImagePlaybackStatus(this.mediaElement.status) as PlaybackStatus; + } - /** - * Return get playback Status - * @returns {PlaybackStatus} - Play back Status - */ - public getPlaybackStatus(): PlaybackStatus { - // TODO: Adapt PlaybackStatus for Images ? - return new ImagePlaybackStatus(this.mediaElement.status) as PlaybackStatus; - } + /** set metadata + * @param title + * @param subtitle + * @param logo + * @param mediaType + * @param transferMode + * @param subtitleTracks + * @param audioTracks + */ + public setMetadata( + title: string, + subtitle: string, + logo: string, + mediaType: EnumMedia, + transferMode: EnumTransferMode, + ) { + // TODO: Adapt metadata for Images ? + this.metadata = new Metadata( + title, + subtitle, + logo, + mediaType, + transferMode, + ); + } - /** - * Set the source of the stream - * @param {string} src - url of the stream - */ - public load(src: string) { - if (src) { - this.mediaElement.src = src; - } else { - this.mediaElement.src = ""; - } - } - /** - * get Table of Mapping With Internal Status - * @returns {{ended: EnumMediaStatus, error: EnumMediaStatus, timeupdate: EnumMediaStatus}} - * @protected - */ - protected getMediaEvents(): any { - return { - ended: EnumMediaStatus.BUFFERING, - error: EnumMediaStatus.ERROR, - load: EnumMediaStatus.PLAYING, - }; + public getMedatadata(): Metadata { + return this.metadata; + } + /** + * Set the source of the stream + * @param {string} src - url of the stream + */ + public load(src: string) { + if (src) { + this.mediaElement.src = src; + } else { + this.mediaElement.src = ""; } + } + /** + * get Table of Mapping With Internal Status + * @returns {{ended: EnumMediaStatus, error: EnumMediaStatus, timeupdate: EnumMediaStatus}} + * @protected + */ + protected getMediaEvents(): any { + return { + ended: EnumMediaStatus.BUFFERING, + error: EnumMediaStatus.UNKNOWN, + load: EnumMediaStatus.PLAYING, + }; + } } diff --git a/src/media/media.ts b/src/media/media.ts index f1c9760..a9443e7 100644 --- a/src/media/media.ts +++ b/src/media/media.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import {MediaChannel} from "../channel/media.channel"; -import {Metadata} from "../protocol/metadata"; -import {PlaybackStatus} from "../protocol/playback.status"; -import {Track} from "../protocol/track"; -import {EnumError} from "../type/enum.error"; -import {EnumMedia} from "../type/enum.media"; -import {EnumMediaStatus} from "../type/enum.media.status"; -import {EnumTrack} from "../type/enum.track"; -import {EnumTransferMode} from "../type/enum.transfermode"; -import {Logger} from "../util/logger"; +import { MediaChannel } from "../channel/media.channel"; +import { Metadata } from "../protocol/metadata"; +import { PlaybackStatus } from "../protocol/playback.status"; +import { Track } from "../protocol/track"; +import { EnumError } from "../type/enum.error"; +import { EnumMedia } from "../type/enum.media"; +import { EnumMediaStatus } from "../type/enum.media.status"; +import { EnumTrack } from "../type/enum.track"; +import { EnumTransferMode } from "../type/enum.transfermode"; +import { Logger } from "../util/logger"; const Log: Logger = Logger.getInstance(); @@ -31,182 +31,192 @@ const Log: Logger = Logger.getInstance(); * Base Class MediaController */ export abstract class Media { - public updateFrequency: number; - public metadata: Metadata; - protected statusHandler: any; - private lastUpdate: number; - - /** - * @constructor: - * @param mediaElement - * @param mediaChannel - */ - constructor(public mediaElement: any, public mediaChannel: MediaChannel) { - this.mediaElement.status = EnumMediaStatus.IDLE; - this.lastUpdate = 0; - this.statusHandler = this.onUpdateStatus.bind(this); - this.metadata = null; - this.addListeners(); - } - - /** - * Return Status - * @returns {any} - */ - public getStatus(): EnumMediaStatus { - return (this.mediaElement) ? this.mediaElement.status as EnumMediaStatus : null; - } - - /** set metadata - * @param title - * @param subtitle - * @param logo - * @param mediaType - * @param transferMode - * @param subtitleTracks - * @param audioTracks - */ - public setMetadata(title: string, subtitle: string, logo: string, mediaType: EnumMedia, - transferMode: EnumTransferMode) { - this.metadata = new Metadata(title, subtitle, logo, mediaType, transferMode); - } - - /** - * Set the source of the stream - * @param {string} src - url of the stream - */ - public abstract load(src: string, autoplay?: boolean); - - /** - * update frequency - * @param frequency - */ - public setUpdateFrequency(frequency: number) { - this.updateFrequency = frequency; - } - - /** - * - * @returns {PlaybackStatus} - */ - public abstract getPlaybackStatus(): PlaybackStatus; // must be implemented in derived class - - public seek(position: number): EnumError { - return EnumError.NO_IMPLEMENTATION; - } - - public setVolume(level: number): EnumError { - return EnumError.NO_IMPLEMENTATION; - } - - public setMute(mute: boolean): EnumError { - return EnumError.NO_IMPLEMENTATION; - } - - public pause(): EnumError { - return EnumError.NO_IMPLEMENTATION; - } - - public stop(): EnumError { - this.clear(); - this.updateStatus(EnumMediaStatus.STOPPED); - return EnumError.OK; - } - - public abort(): EnumError { - this.clear(); - this.updateStatus(EnumMediaStatus.CANCELLED); - return EnumError.OK; - } - - public resume(): EnumError { - return EnumError.NO_IMPLEMENTATION; - } - - /** - * erase media player - */ - public clear(): void { - this.load(null); - this.removeListeners(); - } - - public setTrack(type: EnumTrack, trackId: string, enabled: boolean): EnumError { - return EnumError.NO_IMPLEMENTATION; - } - /** - * return Metadatas - * @returns {Metadata} - */ - public getMedatadata(): Metadata { - return this.metadata; - } - - protected abstract getMediaEvents(); - - /** - * Add Listeners - * @private - */ - protected addListeners(): void { - const events: any = this.getMediaEvents(); - for (const event in events) { - if (events.hasOwnProperty(event)) { - Log.debug("add Event Listener on <<<" + event + ">>>"); - this.mediaElement.addEventListener(event, this.statusHandler); - } - } - } - - /** - * Remove Listeners - * @private - */ - protected removeListeners(): void { - const events: any = this.getMediaEvents(); - for (const event in events) { - if (events.hasOwnProperty(event)) { - this.mediaElement.removeEventListener(event, this.statusHandler); - } - } - } - protected onUpdateMetadata(event): void { - if (! this.mediaElement) { - console.warn("MediaElement is null, ignore event ", event); - return; - } - this.mediaChannel.onUpdateMetadata(this.getMedatadata()); - } - - private onUpdateStatus(event) { - const mapping = this.getMediaEvents(); - this.updateStatus(mapping[event.type]); - this.onUpdateMetadata(event); - } - - private updateStatus(status) { - if (!this.mediaElement) { - Log.warn("MediaElement is null, ignore event ", event); - return; - } - const newUpdate = new Date().getTime(); - - const previousStatus = this.mediaElement.status; - this.mediaElement.status = status; - - // Dispatch Event If Needed - if (previousStatus !== this.mediaElement.status) { - this.mediaChannel.onUpdateStatus(this.mediaElement.status); - } else if ((this.updateFrequency !== 0) && (newUpdate > this.lastUpdate + this.updateFrequency * 1000)) { - this.lastUpdate = newUpdate; - this.mediaChannel.onUpdateStatus(this.getPlaybackStatus()); - } - - // Manage Automatic Transition - if ((this.mediaElement.status === EnumMediaStatus.STOPPED) || - (this.mediaElement.status === EnumMediaStatus.CANCELLED)) { - this.mediaElement.status = EnumMediaStatus.IDLE; - this.mediaChannel.onUpdateStatus(this.getPlaybackStatus()); - } - } + public updateFrequency: number; + public metadata: Metadata; + protected statusHandler: any; + protected metadataHandler: any; + private lastUpdate: number; + + /** + * @constructor: + * @param mediaElement + * @param mediaChannel + */ + constructor(public mediaElement: any, public mediaChannel: MediaChannel) { + this.mediaElement.status = EnumMediaStatus.IDLE; + this.lastUpdate = 0; + // bind media listeners on onUpdateStatus + this.statusHandler = this.onUpdateStatus.bind(this); + this.metadataHandler = this.onUpdateMetadata.bind(this); + this.metadata = null; + this.addListeners(); + } + + /** + * Return Status + * @returns {any} + */ + public getStatus(): EnumMediaStatus { + return this.mediaElement + ? (this.mediaElement.status as EnumMediaStatus) + : null; + } + + /** + * Set the source of the stream + * @param {string} src - url of the stream + */ + public abstract load(src: string, autoplay?: boolean); + + /** + * update frequency + * @param frequency + */ + public setUpdateFrequency(frequency: number) { + this.updateFrequency = frequency; + } + + /** + * + * @returns {PlaybackStatus} + */ + public abstract getPlaybackStatus(): PlaybackStatus; // must be implemented in derived class + + /** + * + * @returns {Metadata} + */ + public abstract setMetadata( + title: string, + subtitle: string, + logo: string, + mediaType: EnumMedia, + transferMode: EnumTransferMode, + ); + /** + * return Metadatas + * @returns {Metadata} + */ + public abstract getMedatadata(): Metadata; + + public seek(position: number): EnumError { + return EnumError.NO_IMPLEMENTATION; + } + + public setVolume(level: number): EnumError { + return EnumError.NO_IMPLEMENTATION; + } + + public setMute(mute: boolean): EnumError { + return EnumError.NO_IMPLEMENTATION; + } + + public pause(): EnumError { + return EnumError.NO_IMPLEMENTATION; + } + + public stop(): EnumError { + this.clear(); + this.updateStatus(EnumMediaStatus.IDLE); + return EnumError.OK; + } + + public abort(): EnumError { + this.clear(); + this.updateStatus(EnumMediaStatus.IDLE); + return EnumError.OK; + } + + public resume(): EnumError { + return EnumError.NO_IMPLEMENTATION; + } + + /** + * erase media player + */ + public clear(): void { + this.load(null); + this.removeListeners(); + } + + public setTrack( + type: EnumTrack, + trackId: string, + enabled: boolean, + ): EnumError { + return EnumError.NO_IMPLEMENTATION; + } + + protected abstract getMediaEvents(); + + /** + * Add Listeners + * @private + */ + protected addListeners(): void { + const events: any = this.getMediaEvents(); + for (const event in events) { + if (events.hasOwnProperty(event)) { + Log.debug("add Event Listener on <<<" + event + ">>>"); + this.mediaElement.addEventListener(event, this.statusHandler); + } + } + this.mediaElement.addEventListener("loadedmetadata", this.metadataHandler); + } + + /** + * Remove Listeners + * @private + */ + protected removeListeners(): void { + const events: any = this.getMediaEvents(); + for (const event in events) { + if (events.hasOwnProperty(event)) { + this.mediaElement.removeEventListener(event, this.statusHandler); + } + } + } + protected onUpdateMetadata(event): void { + if (!this.mediaElement) { + console.warn("MediaElement is null, ignore event ", event); + return; + } + this.mediaChannel.onUpdateMetadata(this.getMedatadata()); + } + + private onUpdateStatus(event) { + const mapping = this.getMediaEvents(); + this.updateStatus(mapping[event.type]); + } + + private updateStatus(status) { + if (!this.mediaElement) { + Log.warn("MediaElement is null, ignore event ", event); + return; + } + const newUpdate = new Date().getTime(); + + const previousStatus = this.mediaElement.status; + this.mediaElement.status = status; + + // Dispatch Event If Needed + if (previousStatus !== this.mediaElement.status) { + this.mediaChannel.onUpdateStatus(this.mediaElement.status); + } else if ( + this.updateFrequency !== 0 && + newUpdate > this.lastUpdate + this.updateFrequency * 1000 + ) { + this.lastUpdate = newUpdate; + this.mediaChannel.onUpdateStatus(this.getPlaybackStatus()); + } + + // Manage Automatic Transition + if ( + this.mediaElement.status === EnumMediaStatus.IDLE || + this.mediaElement.status === EnumMediaStatus.UNKNOWN + ) { + this.mediaElement.status = EnumMediaStatus.IDLE; + this.mediaChannel.onUpdateStatus(this.getPlaybackStatus()); + } + } } diff --git a/src/media/video.media.ts b/src/media/video.media.ts index 4dc77da..c9e9ddf 100644 --- a/src/media/video.media.ts +++ b/src/media/video.media.ts @@ -13,16 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import {PlaybackStatus} from "../protocol/playback.status"; -import {Track} from "../protocol/track"; -import {EnumError} from "../type/enum.error"; -import {EnumMediaStatus} from "../type/enum.media.status"; -import {EnumTrack} from "../type/enum.track"; -import {EnumTransferMode} from "../type/enum.transfermode"; -import {Logger} from "../util/logger"; -import {Media} from "./media"; -import {VideoPlaybackStatus} from "./video.playback.status"; +import { Metadata } from "../protocol/metadata"; +import { PlaybackStatus } from "../protocol/playback.status"; +import { Track } from "../protocol/track"; +import { EnumError } from "../type/enum.error"; +import { EnumMedia } from "../type/enum.media"; +import { EnumMediaStatus } from "../type/enum.media.status"; +import { EnumTrack } from "../type/enum.track"; +import { EnumTransferMode } from "../type/enum.transfermode"; +import { Logger } from "../util/logger"; +import { Media } from "./media"; +import { VideoPlaybackStatus } from "./video.playback.status"; const TAG: string = " [VideoMedia] "; const Log: Logger = Logger.getInstance(); @@ -30,206 +31,277 @@ const Log: Logger = Logger.getInstance(); * Media Controller for Audio/Video */ export class VideoMedia extends Media { + /** + * Get Media Player Status + * @returns {PlaybackStatus} + */ + public getPlaybackStatus(): PlaybackStatus { + return new VideoPlaybackStatus( + this.mediaElement.status, + this.mediaElement.volume, + this.mediaElement.muted, + this.mediaElement.currentTime, + this.mediaElement.duration, + ) as PlaybackStatus; + } - /** - * Get Media Player Status - * @returns {PlaybackStatus} - */ - public getPlaybackStatus(): PlaybackStatus { - return new VideoPlaybackStatus(this.mediaElement.status, - this.mediaElement.volume, - this.mediaElement.muted, - this.mediaElement.currentTime, - this.mediaElement.duration) as PlaybackStatus; - } + /** set metadata + * @param title + * @param subtitle + * @param logo + * @param mediaType + * @param transferMode + * @param subtitleTracks + * @param audioTracks + */ + public setMetadata( + title: string, + subtitle: string, + logo: string, + mediaType: EnumMedia, + transferMode: EnumTransferMode, + ) { + this.metadata = new Metadata( + title, + subtitle, + logo, + mediaType, + transferMode, + ); + } - public setTrack(type: EnumTrack, trackId: string, enabled: boolean): EnumError { - let status = this.getStatus(); - let mediaVideo: any = this.mediaElement; - let i: number = 0; - if ((status === EnumMediaStatus.BUFFERING) || - (status === EnumMediaStatus.PLAYING) || - (status === EnumMediaStatus.PAUSED)) { - try { - let id = parseFloat(trackId); - switch (type) { - case EnumTrack.AUDIO: - for (i = 0; i < mediaVideo.audioTracks.length; i++ ) { - mediaVideo.audioTracks[i].enabled = ! enabled; - } - mediaVideo.audioTracks[id].enabled = enabled; - break; - case EnumTrack.VIDEO: - for (i = 0; i < mediaVideo.videoTracks.length; i++ ) { - mediaVideo.videoTracks[i].selected = ! enabled; - } - mediaVideo.videoTracks[id].selected = enabled; - break; - case EnumTrack.TEXT: - for (i = 0; i < mediaVideo.textTracks.length; i++ ) { - mediaVideo.textTracks[i].mode = enabled ? "disabled" : "showing"; - } - mediaVideo.textTracks[id].mode = enabled ? "showing" : "disabled"; - break; - default: - return EnumError.INVALID_TRACK; - } - return EnumError.OK; - }catch (e) { - Log.warn(TAG + "setTrack error : ", e); - return EnumError.INVALID_TRACK; + public getMedatadata(): Metadata { + this.updateTracks(); + return this.metadata; + } + + public setTrack( + type: EnumTrack, + trackId: string, + enabled: boolean, + ): EnumError { + let status = this.getStatus(); + let mediaVideo: any = this.mediaElement; + let i: number = 0; + if ( + status === EnumMediaStatus.BUFFERING || + status === EnumMediaStatus.PLAYING || + status === EnumMediaStatus.PAUSED + ) { + try { + let id = parseFloat(trackId); + switch (type) { + case EnumTrack.AUDIO: + for (i = 0; i < mediaVideo.audioTracks.length; i++) { + mediaVideo.audioTracks[i].enabled = !enabled; } - } else { - return EnumError.PLAYER_INVALID_STATE; - } - } - public seek(position): EnumError { - let status = this.getStatus(); - if ((status !== EnumMediaStatus.BUFFERING) && - (status !== EnumMediaStatus.PLAYING) && - (status !== EnumMediaStatus.PAUSED)) { - return EnumError.PLAYER_INVALID_STATE; + mediaVideo.audioTracks[id].enabled = enabled; + break; + case EnumTrack.VIDEO: + for (i = 0; i < mediaVideo.videoTracks.length; i++) { + mediaVideo.videoTracks[i].selected = !enabled; + } + mediaVideo.videoTracks[id].selected = enabled; + break; + case EnumTrack.TEXT: + for (i = 0; i < mediaVideo.textTracks.length; i++) { + mediaVideo.textTracks[i].mode = enabled ? "disabled" : "showing"; + } + mediaVideo.textTracks[id].mode = enabled ? "showing" : "disabled"; + break; + default: + return EnumError.INVALID_TRACK; } - this.mediaElement.currentTime = position; return EnumError.OK; + } catch (e) { + Log.warn(TAG + "setTrack error : ", e); + return EnumError.INVALID_TRACK; + } + } else { + return EnumError.PLAYER_INVALID_STATE; + } + } + public seek(position): EnumError { + let status = this.getStatus(); + if ( + status !== EnumMediaStatus.BUFFERING && + status !== EnumMediaStatus.PLAYING && + status !== EnumMediaStatus.PAUSED + ) { + return EnumError.PLAYER_INVALID_STATE; } + this.mediaElement.currentTime = position; + return EnumError.OK; + } - public setVolume(level: number): EnumError { - let status = this.getStatus(); - if ((status !== EnumMediaStatus.PLAYING) && (status !== EnumMediaStatus.PAUSED)) { - return EnumError.PLAYER_INVALID_STATE; - } - this.mediaElement.volume = level; - return EnumError.OK; + public setVolume(level: number): EnumError { + let status = this.getStatus(); + if ( + status !== EnumMediaStatus.PLAYING && + status !== EnumMediaStatus.PAUSED + ) { + return EnumError.PLAYER_INVALID_STATE; } + this.mediaElement.volume = level; + return EnumError.OK; + } - public setMute(mute: boolean): EnumError { - let status = this.getStatus(); - if ((status !== EnumMediaStatus.PLAYING) && (status !== EnumMediaStatus.PAUSED)) { - return EnumError.PLAYER_INVALID_STATE; - } - this.mediaElement.muted = mute; - return EnumError.OK; + public setMute(mute: boolean): EnumError { + let status = this.getStatus(); + if ( + status !== EnumMediaStatus.PLAYING && + status !== EnumMediaStatus.PAUSED + ) { + return EnumError.PLAYER_INVALID_STATE; } + this.mediaElement.muted = mute; + return EnumError.OK; + } - public pause(): EnumError { - let status = this.getStatus(); - if ((status !== EnumMediaStatus.BUFFERING) && (status !== EnumMediaStatus.PLAYING)) { - return EnumError.PLAYER_INVALID_STATE; - } - this.mediaElement.pause(); - return EnumError.OK; + public pause(): EnumError { + let status = this.getStatus(); + if ( + status !== EnumMediaStatus.BUFFERING && + status !== EnumMediaStatus.PLAYING + ) { + return EnumError.PLAYER_INVALID_STATE; } + this.mediaElement.pause(); + return EnumError.OK; + } - public resume(): EnumError { - let status = this.getStatus(); - if (status !== EnumMediaStatus.PAUSED) { - return EnumError.PLAYER_INVALID_STATE; - } - this.mediaElement.play(); - return EnumError.OK; + public resume(): EnumError { + let status = this.getStatus(); + if (status !== EnumMediaStatus.PAUSED) { + return EnumError.PLAYER_INVALID_STATE; } - /** - * Set the source of the stream - * @param {string} src - url of the stream - */ - public load(src: string, autoplay?: boolean) { - if (autoplay !== undefined) { - this.mediaElement.autoplay = autoplay; - } - if (src) { - this.mediaElement.src = src; - } else { - this.mediaElement.pause(); - this.mediaElement.src = ""; - this.mediaElement.load(); - } + this.mediaElement.play(); + return EnumError.OK; + } + /** + * Set the source of the stream + * @param {string} src - url of the stream + */ + public load(src: string, autoplay?: boolean) { + if (autoplay !== undefined) { + this.mediaElement.autoplay = autoplay; } - - /** - * get is Live Status - * @returns {boolean} - */ - get isLive(): boolean { - return (this.metadata.transferMode === EnumTransferMode.STREAMED); + if (src) { + this.mediaElement.src = src; + } else { + this.mediaElement.pause(); + this.mediaElement.src = ""; + this.mediaElement.load(); } + } + + /** + * get is Live Status + * @returns {boolean} + */ + get isLive(): boolean { + return this.metadata.transferMode === EnumTransferMode.STREAMED; + } - /** - * return Mapping with internal Values - * @returns {{abort: EnumMediaStatus, ended: EnumMediaStatus, error: EnumMediaStatus, loadstart: EnumMediaStatus, - * pause: EnumMediaStatus, playing: EnumMediaStatus, seeking: EnumMediaStatus, timeupdate: EnumMediaStatus}} - * @protected - */ - protected getMediaEvents() { - return { - // TODO: Deal with the state ended ( IDLE ???) - abort: EnumMediaStatus.CANCELLED, - ended: EnumMediaStatus.STOPPED, - error: EnumMediaStatus.ERROR, - loadstart: EnumMediaStatus.BUFFERING, - pause: EnumMediaStatus.PAUSED, - playing: EnumMediaStatus.PLAYING, - seeking: EnumMediaStatus.BUFFERING, - timeupdate: EnumMediaStatus.PLAYING, - }; + /** + * return Mapping with internal Values + * @returns {{abort: EnumMediaStatus, ended: EnumMediaStatus, error: EnumMediaStatus, loadstart: EnumMediaStatus, + * pause: EnumMediaStatus, playing: EnumMediaStatus, seeking: EnumMediaStatus, timeupdate: EnumMediaStatus}} + * @protected + */ + protected getMediaEvents() { + return { + abort: EnumMediaStatus.IDLE, + ended: EnumMediaStatus.IDLE, + error: EnumMediaStatus.UNKNOWN, + loadstart: EnumMediaStatus.BUFFERING, + pause: EnumMediaStatus.PAUSED, + playing: EnumMediaStatus.PLAYING, + seeking: EnumMediaStatus.BUFFERING, + timeupdate: EnumMediaStatus.PLAYING, + }; + } + protected onUpdateMetadata(event): void { + if (!this.mediaElement) { + Log.warn("MediaElement is null, ignore event (" + event.type + ")"); + return; + } + if (!this.metadata) { + Log.warn("Metadata is null !!! ( implementation error )"); + return; } - protected onUpdateMetadata(event): void { - if (! this.mediaElement) { - Log.warn("MediaElement is null, ignore event (" + event.type + ")" ); - return; - } - if (! this.metadata) { - Log.warn("Metadata is null !!! ( implementation error )"); - return; - } + if ( + !( + this.mediaElement.audioTracks && + this.mediaElement.videoTracks && + this.mediaElement.textTracks + ) + ) { + Log.warn("Tracks not implemented !!! ( implementation error )"); + return; + } + let signature: string = JSON.stringify(this.metadata); + this.updateTracks(); + if (JSON.stringify(this.metadata) !== signature) { + this.mediaChannel.onUpdateMetadata(this.getMedatadata()); + } + } - if (! (this.mediaElement.audioTracks && this.mediaElement.videoTracks && this.mediaElement.textTracks)) { - Log.warn("Tracks not implemented !!! ( implementation error )"); - return; - } - let signature: string = JSON.stringify(this.metadata); - // Catch AudioTracks - let i = 0; - let tracks; - tracks = []; - // TODO: Refactor this code (redundancy) - let audioTracks = this.mediaElement.audioTracks; - for (i = 0; i < audioTracks.length; i++ ) { - tracks.push( - new Track( EnumTrack.AUDIO, - i.toString(), - audioTracks[i].enabled, - audioTracks[i].language, - audioTracks[i].label)); - } - this.metadata.audioTracks = tracks; - // Catch VideoTracks - tracks = []; - let videoTracks = this.mediaElement.videoTracks; - for (i = 0; i < videoTracks.length; i++ ) { - tracks.push( - new Track( EnumTrack.VIDEO, - i.toString(), - videoTracks[i].selected, - videoTracks[i].language, - videoTracks[i].label)); - } - this.metadata.videoTracks = tracks; - // Catch TextTracks - tracks = []; - let textTracks = this.mediaElement.textTracks; - for (i = 0; i < textTracks.length; i++ ) { - tracks.push( - new Track( EnumTrack.TEXT, - i.toString(), - textTracks[i].mode === "showing", - textTracks[i].language, - textTracks[i].label)); - } - this.metadata.textTracks = tracks; - if (JSON.stringify(this.metadata) !== signature) { - this.mediaChannel.onUpdateMetadata(this.getMedatadata()); - } + private updateTracks() { + // Catch AudioTracks + let i = 0; + let tracks; + tracks = []; + // TODO: Refactor this code (redundancy) + let audioTracks = this.mediaElement.audioTracks; + if (audioTracks) { + for (i = 0; i < audioTracks.length; i++) { + tracks.push( + new Track( + EnumTrack.AUDIO, + i.toString(), + audioTracks[i].enabled, + audioTracks[i].language, + audioTracks[i].label, + ), + ); + } + this.metadata.audioTracks = tracks; + } + // Catch VideoTracks + tracks = []; + let videoTracks = this.mediaElement.videoTracks; + if (videoTracks) { + for (i = 0; i < videoTracks.length; i++) { + tracks.push( + new Track( + EnumTrack.VIDEO, + i.toString(), + videoTracks[i].selected, + videoTracks[i].language, + videoTracks[i].label, + ), + ); + } + this.metadata.videoTracks = tracks; + } + // Catch TextTracks + tracks = []; + let textTracks = this.mediaElement.textTracks; + if (textTracks) { + for (i = 0; i < textTracks.length; i++) { + tracks.push( + new Track( + EnumTrack.TEXT, + i.toString(), + textTracks[i].mode === "showing", + textTracks[i].language, + textTracks[i].label, + ), + ); + } + this.metadata.textTracks = tracks; } + } } diff --git a/src/ocast.ts b/src/ocast.ts index 96be0bd..93307f6 100755 --- a/src/ocast.ts +++ b/src/ocast.ts @@ -14,15 +14,15 @@ * limitations under the License. */ -import {Channel} from "./channel/channel"; -import {MediaChannel} from "./channel/media.channel"; -import {WebappChannel} from "./channel/webapp.channel"; -import {Transport} from "./protocol/transport"; -import {TransportMessage} from "./protocol/transport.message"; -import {EnumError} from "./type/enum.error"; -import {EnumProtocol} from "./type/enum.protocol"; -import {EnumTransport} from "./type/enum.transport"; -import {Logger} from "./util/logger"; +import { Channel } from "./channel/channel"; +import { MediaChannel } from "./channel/media.channel"; +import { WebappChannel } from "./channel/webapp.channel"; +import { Transport } from "./protocol/transport"; +import { TransportMessage } from "./protocol/transport.message"; +import { EnumError } from "./type/enum.error"; +import { EnumProtocol } from "./type/enum.protocol"; +import { EnumTransport } from "./type/enum.transport"; +import { Logger } from "./util/logger"; const TAG: string = " [OCast] "; const Log: Logger = Logger.getInstance(); @@ -31,154 +31,155 @@ const Log: Logger = Logger.getInstance(); * OCast Root Object */ export class OCast { - public debug = false; - private ws: WebSocket = null; - private channels: Channel[] = []; - - /** - * OCast Root Object - * @constructor - */ - constructor() { - this.setupMediaChannel(); - this.setupWebappChannel(); + public debug = false; + private ws: WebSocket = null; + private channels: Channel[] = []; + + /** + * OCast Root Object, create default channel 'webapp' and 'media' + * @constructor + */ + constructor() { + this.setupMediaChannel(); + this.setupWebappChannel(); + } + + /** + * Public function to Start initialization + * @public + */ + public start() { + this.ws = new WebSocket(EnumProtocol.PROTOCOL + EnumProtocol.HOST + ":" + EnumProtocol.PORT + EnumProtocol.PATH); + this.ws.onopen = this.onConnected.bind(this); + this.ws.onmessage = this.onMessage.bind(this); + this.ws.onerror = this.onError.bind(this); + this.ws.onclose = this.onClose.bind(this); + } + + /** + * Create a Custom Channel + * @param service + * @returns {MediaChannel} + * @public + */ + public createChannel(service: string): Channel { + // todo: Manage duplicate channel + let channel: Channel = new Channel(service); + channel.setSocket(this.ws); + this.channels[service] = channel; + return channel; + } + + /** + * Return a MediaChannel + * @returns {MediaChannel} + * @public + */ + public getMediaChannel(): MediaChannel { + return this.getChannel(MediaChannel.NAMESPACE) as MediaChannel; + } + + /** + * Return WebappChannel + * @returns {WebappChannel} + * @public + */ + public getWebappChannel(): WebappChannel { + return this.getChannel(WebappChannel.NAMESPACE) as WebappChannel; + } + + /** + * Return Channel + * @param {string} service Name + * @returns {Channel} + * @public + */ + public getChannel(service: string): Channel { + return this.channels[service] as Channel; + } + /** + * Initialize MediaChannel + * @private + */ + private setupMediaChannel() { + let channel = new MediaChannel(); + this.channels[channel.name] = channel; + } + + /** + * Initialize MediaChannel + * @private + */ + private setupWebappChannel(): void { + let channel: WebappChannel = new WebappChannel(); + this.channels[channel.name] = channel; + } + /** + * publish message on internal Bus + * @param {Transport} transport - transport Message + * @private + */ + private publish(transport: Transport) { + if (this.channels.hasOwnProperty(transport.message.service)) { + let channel = this.channels[transport.message.service]; + channel.onMessage(transport); + } else { + Log.warn("Unknown namespace <<<" + transport.message.service + ">>>"); + let message = new Transport( + transport.dst, + transport.src, + EnumTransport.REPLY, + transport.id, + new TransportMessage(transport.message.service, { + params: { code: EnumError.INVALID_NAMESPACE }, + }), + ); + this.ws.send(JSON.stringify(message)); } - - /** - * Public function to Start initialization - * @public - */ - public start() { - Log.info(TAG + "init WebSocket with url : " + EnumProtocol.PROTOCOL + EnumProtocol.HOST + ":" + - EnumProtocol.PORT + EnumProtocol.PATH); - this.ws = new WebSocket(EnumProtocol.PROTOCOL + EnumProtocol.HOST + ":" + EnumProtocol.PORT + - EnumProtocol.PATH); - this.ws.onopen = this.onConnected.bind(this); - this.ws.onmessage = this.onMessage.bind(this); - this.ws.onerror = this.onError.bind(this); - this.ws.onclose = this.onClose.bind(this); + } + + /** + * Handler to receive messages + * @param event + * @private + */ + private onMessage(event) { + Log.debug(TAG + "receive message : " + event.data); + let message: Transport = JSON.parse(event.data); + try { + this.publish(message); + } catch (e) { + // todo: Catch a better way internal Errors (with call stack) + console.error("Uncaught exception" + e); } - - /** - * Create a Custom Channel - * @param service - * @returns {MediaChannel} - * @public - */ - public createChannel(service: string): Channel { - // todo: Manage duplicate channel - let channel: Channel = new Channel(service); + } + private onError(error) { + Log.info(TAG + "receive error event : ", error); + } + + private onClose(close) { + Log.info(TAG + "websocket is closed "); + } + + /** + * Send Connected Event when Connection Opened + * @param event + */ + private onConnected(event) { + Log.info(TAG + "websocket onConnected event"); + this.updateSocketChannel(); + } + + /** + * Set websocket on all channels + * @private + */ + private updateSocketChannel(): void { + for (let key in this.channels) { + if (this.channels.hasOwnProperty(key)) { + let channel: Channel = this.channels[key]; channel.setSocket(this.ws); - this.channels[service] = channel; - return channel; - } - - /** - * Return a MediaChannel - * @returns {MediaChannel} - * @public - */ - public getMediaChannel(): MediaChannel { - return this.getChannel(MediaChannel.NAMESPACE) as MediaChannel; - } - - /** - * Return WebappChannel - * @returns {WebappChannel} - * @public - */ - public getWebappChannel(): WebappChannel { - return this.getChannel(WebappChannel.NAMESPACE) as WebappChannel; - } - - /** - * Return Channel - * @param {string} service Name - * @returns {Channel} - * @public - */ - public getChannel(service: string): Channel { - return this.channels[service] as Channel; - } - - /** - * publish message on internal Bus - * @param {Transport} transport - transport Message - * @private - */ - private publish(transport: Transport) { - if (this.channels.hasOwnProperty(transport.message.service)) { - let channel = this.channels[transport.message.service]; - channel.onMessage(transport); - } else { - Log.warn("Unknown namespace <<<" + transport.message.service + ">>>"); - let message = new Transport(transport.dst, transport.src, EnumTransport.REPLY, transport.id, - new TransportMessage(transport.message.service, {params: {code: EnumError.INVALID_NAMESPACE}})); - this.ws.send(JSON.stringify(message)); - } - } - - private onError(error) { - Log.info(TAG + "receive error event : ", error); - } - - private onClose(close) { - Log.info(TAG + "websocket is closed "); - } - - /** - * Send Connected Event when Connection Opened - * @param event - */ - private onConnected(event) { - Log.info(TAG + "websocket onConnected event"); - this.updateSocketChannel(); - } - - /** - * Handler to receive messages - * @param event - * @private - */ - private onMessage(event) { - Log.debug(TAG + "receive message : " + event.data); - let message: Transport = JSON.parse(event.data); - try { - this.publish(message); - } catch (e) { - // todo: Catch a better way internal Errors (with call stack) - console.error("Uncaught exception" + e); - } - } - - /** - * Initialize MediaChannel - * @private - */ - private setupMediaChannel() { - let channel = new MediaChannel(); - this.channels[channel.name] = channel; - } - - /** - * Initialize MediaChannel - * @private - */ - private setupWebappChannel(): void { - let channel: WebappChannel = new WebappChannel(); - this.channels[channel.name] = channel; - } - - /** - * Set websocket on all channels - * @private - */ - private updateSocketChannel(): void { - for (let key in this.channels) { - if (this.channels.hasOwnProperty(key)) { - let channel: Channel = this.channels[key]; - channel.setSocket(this.ws); - } - } + } } + } } diff --git a/src/type/enum.media.status.ts b/src/type/enum.media.status.ts index b1bc78f..29ea644 100644 --- a/src/type/enum.media.status.ts +++ b/src/type/enum.media.status.ts @@ -18,11 +18,9 @@ * Media Status Enum */ export enum EnumMediaStatus { - IDLE = "idle", - BUFFERING = "buffering", - PLAYING = "playing", - PAUSED = "paused", - STOPPED = "stopped", - CANCELLED = "cancelled", - ERROR = "error", + UNKNOWN = 0, + IDLE = 1, + PLAYING = 2, + PAUSED = 3, + BUFFERING = 4, } diff --git a/test/channel.mediachannel.spec.ts b/test/channel.mediachannel.spec.ts index 6f1ce63..620676d 100644 --- a/test/channel.mediachannel.spec.ts +++ b/test/channel.mediachannel.spec.ts @@ -186,7 +186,7 @@ describe("MediaChannel", () => { } ); return testPromise.then((result) => { let expected = - expect(result).to.equal(getExpectedStatus("paused", EnumError.OK)); + expect(result).to.equal(getExpectedStatus(3, EnumError.OK)); }); }); From ed853dc95371b76bc7d9a5eac6f402db8f88835e Mon Sep 17 00:00:00 2001 From: Sebastien Durand <11314079+sebdurand@users.noreply.github.com> Date: Tue, 19 Jun 2018 15:57:12 +0200 Subject: [PATCH 02/13] 1.0.4 (#12) * refactoring : playbackstatus as int * fix reply connection status * fix getMetadata * fix tracks * fix format code * Fix playback status, connection status, metadata and tracks support. * refactoring : playbackstatus as int * fix reply connection status * fix getMetadata * fix tracks * fix format code * fix npmjs deploy * fix npm deploy --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a01ca29..0aaf679 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ocast-sdk", - "version": "1.0.3", + "version": "1.0.4", "engines": { "node": ">=8.6.0" }, @@ -75,3 +75,4 @@ "instrument": true } } + From f52df963b81244813e0c0d774e387c11ea2660bd Mon Sep 17 00:00:00 2001 From: Sebastien Durand <11314079+sebdurand@users.noreply.github.com> Date: Thu, 19 Jul 2018 16:35:53 +0200 Subject: [PATCH 03/13] fixes #6 #7 #8 #9 #13 (#18) * fix rollup export interface @see https://github.com/rollup/rollup-plugin-typescript/issues/28 * fix attach/detach listeners after load/clear * fix return id tracks not implemented * fix attach/detach listeners after load/clear * fix return id tracks not implemented * Update package.json * Update package.json * add skip_cleanup: true / deploy / npm --- .travis.yml | 3 ++- package-lock.json | 2 +- package.json | 1 - src/index.ts | 1 + src/media/image.media.ts | 1 + src/media/media.ts | 1 - src/media/video.media.ts | 8 ++++---- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1c93cf..627f90a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,13 +9,14 @@ install: - npm install script: - npm run doc - - npm test + #- npm test deploy: - provider: pages local_dir: public skip_cleanup: true github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard - provider: npm + skip_cleanup: true email: "sebast.durand@orange.com" api_key: $NPM_TOKEN on: diff --git a/package-lock.json b/package-lock.json index 9062d2a..0cf2caf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14246,4 +14246,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 0aaf679..1ea3a37 100644 --- a/package.json +++ b/package.json @@ -75,4 +75,3 @@ "instrument": true } } - diff --git a/src/index.ts b/src/index.ts index 98fa4f0..7b63b46 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import "./channel/media.notifier"; export {EnumError} from "./type/enum.error"; export {EnumMediaStatus} from "./type/enum.media.status"; diff --git a/src/media/image.media.ts b/src/media/image.media.ts index f499c20..e81efe9 100644 --- a/src/media/image.media.ts +++ b/src/media/image.media.ts @@ -70,6 +70,7 @@ export class ImageMedia extends Media { */ public load(src: string) { if (src) { + this.addListeners(); this.mediaElement.src = src; } else { this.mediaElement.src = ""; diff --git a/src/media/media.ts b/src/media/media.ts index a9443e7..4976ed5 100644 --- a/src/media/media.ts +++ b/src/media/media.ts @@ -49,7 +49,6 @@ export abstract class Media { this.statusHandler = this.onUpdateStatus.bind(this); this.metadataHandler = this.onUpdateMetadata.bind(this); this.metadata = null; - this.addListeners(); } /** diff --git a/src/media/video.media.ts b/src/media/video.media.ts index c9e9ddf..04e791d 100644 --- a/src/media/video.media.ts +++ b/src/media/video.media.ts @@ -187,6 +187,7 @@ export class VideoMedia extends Media { this.mediaElement.autoplay = autoplay; } if (src) { + this.addListeners(); this.mediaElement.src = src; } else { this.mediaElement.pause(); @@ -223,11 +224,11 @@ export class VideoMedia extends Media { } protected onUpdateMetadata(event): void { if (!this.mediaElement) { - Log.warn("MediaElement is null, ignore event (" + event.type + ")"); + Log.error("MediaElement is null, ignore event (" + event.type + ")"); return; } if (!this.metadata) { - Log.warn("Metadata is null !!! ( implementation error )"); + Log.error("Metadata is null !!! ( implementation error )"); return; } @@ -238,8 +239,7 @@ export class VideoMedia extends Media { this.mediaElement.textTracks ) ) { - Log.warn("Tracks not implemented !!! ( implementation error )"); - return; + Log.debug("Tracks not implemented !!! ( implementation error )"); } let signature: string = JSON.stringify(this.metadata); this.updateTracks(); From e018cb8c4e40df134814a007d6292c19b25993d0 Mon Sep 17 00:00:00 2001 From: sebdurand Date: Thu, 19 Jul 2018 16:37:25 +0200 Subject: [PATCH 04/13] update protocol --- src/type/enum.protocol.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/type/enum.protocol.ts b/src/type/enum.protocol.ts index b9de035..752fa3b 100644 --- a/src/type/enum.protocol.ts +++ b/src/type/enum.protocol.ts @@ -19,8 +19,8 @@ */ export enum EnumProtocol { /** test protocol */ - PROTOCOL = "ws://", - PORT = 4434, + PROTOCOL = "wss://", + PORT = 4433, HOST = "localhost", PATH = "/ocast", OK_STATUS = "OK", From 495da629980cd436af7d3037452ac571ce72f88a Mon Sep 17 00:00:00 2001 From: sebdurand Date: Thu, 19 Jul 2018 16:50:44 +0200 Subject: [PATCH 05/13] fix handle propertly transmission errors --- src/ocast.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ocast.ts b/src/ocast.ts index 93307f6..e156376 100755 --- a/src/ocast.ts +++ b/src/ocast.ts @@ -145,6 +145,10 @@ export class OCast { */ private onMessage(event) { Log.debug(TAG + "receive message : " + event.data); + if(event.data.type === EnumTransport.REPLY && event.data.status !== "ok"){ + Log.error(TAG +"receive error message : " + event.data.status); + return; + } let message: Transport = JSON.parse(event.data); try { this.publish(message); From 1bcca73b55327d98887bbb52375113eaca3df870 Mon Sep 17 00:00:00 2001 From: sebdurand Date: Thu, 19 Jul 2018 16:55:10 +0200 Subject: [PATCH 06/13] fix lint errors --- src/ocast.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ocast.ts b/src/ocast.ts index e156376..1dcf5c7 100755 --- a/src/ocast.ts +++ b/src/ocast.ts @@ -145,8 +145,8 @@ export class OCast { */ private onMessage(event) { Log.debug(TAG + "receive message : " + event.data); - if(event.data.type === EnumTransport.REPLY && event.data.status !== "ok"){ - Log.error(TAG +"receive error message : " + event.data.status); + if (event.data.type === EnumTransport.REPLY && event.data.status !== "ok") { + Log.error(TAG + "receive error message : " + event.data.status); return; } let message: Transport = JSON.parse(event.data); From 0f8e782cc40cd7b59d2696cd48e569070aa37471 Mon Sep 17 00:00:00 2001 From: GERMA Delphin Ext IMT/OLS Date: Fri, 20 Jul 2018 11:10:16 +0200 Subject: [PATCH 07/13] fix: Reactivate tests --- .travis.yml | 2 +- src/i-ocast-init.ts | 4 ++++ src/ocast.ts | 9 +++++++-- test/.ocast.spec.ts | 5 ++++- test/channel.channel.spec.ts | 5 ++++- test/channel.mediachannel.spec.ts | 5 ++++- 6 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 src/i-ocast-init.ts diff --git a/.travis.yml b/.travis.yml index 627f90a..f37ac62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ install: - npm install script: - npm run doc - #- npm test + - npm test deploy: - provider: pages local_dir: public diff --git a/src/i-ocast-init.ts b/src/i-ocast-init.ts new file mode 100644 index 0000000..3435206 --- /dev/null +++ b/src/i-ocast-init.ts @@ -0,0 +1,4 @@ +export interface IOcastInit { + webSocketProtocol?: string; + webSocketPort?: number; +} \ No newline at end of file diff --git a/src/ocast.ts b/src/ocast.ts index 1dcf5c7..0cdc55c 100755 --- a/src/ocast.ts +++ b/src/ocast.ts @@ -23,6 +23,7 @@ import { EnumError } from "./type/enum.error"; import { EnumProtocol } from "./type/enum.protocol"; import { EnumTransport } from "./type/enum.transport"; import { Logger } from "./util/logger"; +import { IOcastInit } from "./i-ocast-init"; const TAG: string = " [OCast] "; const Log: Logger = Logger.getInstance(); @@ -34,14 +35,18 @@ export class OCast { public debug = false; private ws: WebSocket = null; private channels: Channel[] = []; + private initParameters: IOcastInit = null; /** * OCast Root Object, create default channel 'webapp' and 'media' * @constructor */ - constructor() { + constructor(initParameters?: IOcastInit) { this.setupMediaChannel(); this.setupWebappChannel(); + this.initParameters = initParameters || {}; + this.initParameters.webSocketProtocol = this.initParameters.webSocketProtocol || EnumProtocol.PROTOCOL; + this.initParameters.webSocketPort = this.initParameters.webSocketPort || EnumProtocol.PORT; } /** @@ -49,7 +54,7 @@ export class OCast { * @public */ public start() { - this.ws = new WebSocket(EnumProtocol.PROTOCOL + EnumProtocol.HOST + ":" + EnumProtocol.PORT + EnumProtocol.PATH); + this.ws = new WebSocket(this.initParameters.webSocketProtocol + EnumProtocol.HOST + ":" + this.initParameters.webSocketPort + EnumProtocol.PATH); this.ws.onopen = this.onConnected.bind(this); this.ws.onmessage = this.onMessage.bind(this); this.ws.onerror = this.onError.bind(this); diff --git a/test/.ocast.spec.ts b/test/.ocast.spec.ts index 0f3b9f0..3eceba4 100755 --- a/test/.ocast.spec.ts +++ b/test/.ocast.spec.ts @@ -19,7 +19,10 @@ global.WebSocket = WebSocket; const broker = d2r.broker; const client = d2r.client; -let ocast: OCast = new OCast(); +let ocast: OCast = new OCast({ + webSocketPort: 4434, + webSocketProtocol: "wss://" +}); let dummyVideoPlayer: VideoPlayer = new VideoPlayer(); const Log: Logger = Logger.getInstance(); diff --git a/test/channel.channel.spec.ts b/test/channel.channel.spec.ts index ee1d48e..63c51eb 100644 --- a/test/channel.channel.spec.ts +++ b/test/channel.channel.spec.ts @@ -17,7 +17,10 @@ global.WebSocket = WebSocket; const broker = d2r.broker; const client = d2r.client; -let ocast: OCast = new OCast(); +let ocast: OCast = new OCast({ + webSocketPort: 4434, + webSocketProtocol: "ws://" +}); const Log: Logger = Logger.getInstance(); diff --git a/test/channel.mediachannel.spec.ts b/test/channel.mediachannel.spec.ts index 620676d..40bf61e 100644 --- a/test/channel.mediachannel.spec.ts +++ b/test/channel.mediachannel.spec.ts @@ -20,7 +20,10 @@ import {ImagePlayer} from "./mock/image.player"; const broker = d2r.broker; const client = d2r.client; -let ocast: OCast = new OCast(); +let ocast: OCast = new OCast({ + webSocketPort: 4434, + webSocketProtocol: "ws://" +}); let dummyVideoPlayer: VideoPlayer = new VideoPlayer(); let dummyImagePlayer: ImagePlayer = new ImagePlayer(); let sequenceId: number = 4; From a8f111c1d646c6913799acf57e9504f59d6c440f Mon Sep 17 00:00:00 2001 From: GERMA Delphin Ext IMT/OLS Date: Fri, 20 Jul 2018 11:14:16 +0200 Subject: [PATCH 08/13] refactor: Use global['WebSocket'] instead of global.WebSocket for Typescript type detection --- test/.ocast.spec.ts | 2 +- test/channel.channel.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/.ocast.spec.ts b/test/.ocast.spec.ts index 3eceba4..4fd69c9 100755 --- a/test/.ocast.spec.ts +++ b/test/.ocast.spec.ts @@ -14,7 +14,7 @@ import util = require("util"); const expect = chai.expect; import WebSocket = require("ws"); -global.WebSocket = WebSocket; +global['WebSocket'] = WebSocket; const broker = d2r.broker; const client = d2r.client; diff --git a/test/channel.channel.spec.ts b/test/channel.channel.spec.ts index 63c51eb..bcc35b4 100644 --- a/test/channel.channel.spec.ts +++ b/test/channel.channel.spec.ts @@ -12,7 +12,7 @@ import util = require("util"); const expect = chai.expect; import WebSocket = require("ws"); -global.WebSocket = WebSocket; +global['WebSocket'] = WebSocket; const broker = d2r.broker; const client = d2r.client; From bfda11b72b4ca2229299e9b7c4d2ebeb9bd5ceb2 Mon Sep 17 00:00:00 2001 From: GERMA Delphin Ext IMT/OLS Date: Fri, 20 Jul 2018 11:31:14 +0200 Subject: [PATCH 09/13] fix: Add annotations to allow minify #5 --- src/channel/enum.media.messages.ts | 13 ++ src/channel/media.channel.ts | 254 ++++++++++++++++++++++------- src/util/function.helper.ts | 45 ----- test/util.function.helper.spec.ts | 35 ---- 4 files changed, 210 insertions(+), 137 deletions(-) create mode 100644 src/channel/enum.media.messages.ts delete mode 100644 src/util/function.helper.ts delete mode 100644 test/util.function.helper.spec.ts diff --git a/src/channel/enum.media.messages.ts b/src/channel/enum.media.messages.ts new file mode 100644 index 0000000..0788713 --- /dev/null +++ b/src/channel/enum.media.messages.ts @@ -0,0 +1,13 @@ +export enum EnumMediaMessage { + PAUSE = "pause", + RESUME = "resume", + SEEK = "seek", + TRACK = "track", + STOP = "stop", + CLOSE = "close", + VOLUME = "volume", + GET_PLAYBACK_STATUS = "getPlaybackStatus", + GET_METADATA = "getMetadata", + MUTE = "mute", + PREPARE = "prepare" +} \ No newline at end of file diff --git a/src/channel/media.channel.ts b/src/channel/media.channel.ts index 2c36644..0544cfb 100644 --- a/src/channel/media.channel.ts +++ b/src/channel/media.channel.ts @@ -26,14 +26,18 @@ import {EnumMediaStatus} from "../type/enum.media.status"; import {EnumTrack} from "../type/enum.track"; import {EnumTransferMode} from "../type/enum.transfermode"; import {EnumTransport} from "../type/enum.transport"; -import {FunctionHelper} from "../util/function.helper"; import {Logger} from "../util/logger"; import {Channel} from "./channel"; import {IMediaNotifier} from "./media.notifier"; +import {EnumMediaMessage} from './enum.media.messages'; const TAG: string = " [MediaChannel] "; const Log: Logger = Logger.getInstance(); +//Manage annotations to call methods by transport message +//Store all methods/message type +const methodsByMessage: { [key: string]: IMethodWithParams } = {}; + /** * MediaChannel Class dedicated to OCast Protocol */ @@ -44,7 +48,6 @@ export class MediaChannel extends Channel { METADATA_CHANGED: "metadataChanged", PLAYBACK_STATUS: "playbackStatus", }; - private static PREFIX: string = "do"; private media: Media = null; private notifier: IMediaNotifier; private medias: Media[] = []; @@ -81,65 +84,75 @@ export class MediaChannel extends Channel { /** * Implements specific parsing for this channel + * * @param {Transport} transport - Message to send */ - public onMessage(transport: Transport) { - const method = MediaChannel.PREFIX + FunctionHelper.capitalizeFirstLetter(transport.message.data.name); - const params = transport.message.data.params != null ? transport.message.data.params : {}; - const methodParams = []; - - // Method to call specific implementation - if (typeof this[method] === "function") { - const requiredParams = FunctionHelper.getParamNames(this[method]); - let validate = true; - // Add Options in params ... - params.options = transport.message.data.options; - params.id = transport.id; - params.src = transport.src; - - for (const key in requiredParams) { - if (!params.hasOwnProperty(requiredParams[key])) { - Log.error(TAG + "Mandatory parameter is not found <<" + requiredParams[key] + ">>"); - validate = false; - } else { - methodParams.push(params[requiredParams[key]]); - } + public onMessage(transport: Transport): void { + //Check if message is supported + if (!methodsByMessage[transport.message.data.name]) { + Log.error(TAG + "Message type '" + transport.message.data.name + "' unknown"); + if (transport.type === EnumTransport.COMMAND) { + this.sendReply(transport.id, transport.src, { + name: transport.message.data.name, + params: { code: EnumError.NO_IMPLEMENTATION }, + }); } + return; + } - if (validate) { - try { - Log.debug(TAG + "call " + method + "(" + JSON.stringify(methodParams) + ")"); - const returnCode = this[method].apply(this, methodParams); - if (typeof(returnCode) !== "undefined") { - this.sendReply(transport.id, transport.src, { - name: transport.message.data.name, - params: {code: returnCode}, - }); - } - } catch (e) { - Log.error(TAG + "Error while executing " + method + " with error ", e); - if (transport.type === EnumTransport.COMMAND) { - this.sendReply(transport.id, transport.src, { - name: transport.message.data.name, - params: {code: EnumError.UNKNOWN_ERROR}, - }); + //Explode message to call method + const methodDescriptor: IMethodWithParams = methodsByMessage[transport.message.data.name]; + const paramsToCallMethod: any[] = []; + const paramsMessage: {} = transport.message.data.params || {}; + let validate: boolean = true; + methodDescriptor.params.forEach((paramType: IParamWithNameAndType) => { + switch (paramType.name) { + case "id": + paramsToCallMethod.push(transport.id); + break; + case "src": + paramsToCallMethod.push(transport.src); + break; + case "options": + paramsToCallMethod.push(transport.message.data.options); + break; + default: + if (!paramsMessage.hasOwnProperty(paramType.name)) { + Log.error(TAG + "Mandatory parameter is not found <<" + paramType.name + ">>"); + validate = false; + } else { + paramsToCallMethod.push(paramsMessage[paramType.name]); } - } - } else { - Log.error(TAG + "Error while executing " + method + " paramters missing)"); - if (transport.type === EnumTransport.COMMAND) { - this.sendReply(transport.id, transport.src, { - name: transport.message.data.name, - params: {code: EnumError.PARAMS_MISSING}, - }); - } } - } else { - Log.error(TAG + "Function '" + method + "' not found"); + }); + + //Check if all params are ok + if (!validate) { + Log.error(TAG + "Error while executing " + methodDescriptor.methodName + " paramters missing)"); if (transport.type === EnumTransport.COMMAND) { this.sendReply(transport.id, transport.src, { name: transport.message.data.name, - params: {code: EnumError.NO_IMPLEMENTATION}, + params: { code: EnumError.PARAMS_MISSING }, + }); + } + return; + } + + //All params are ok, call method + try { + const returnCode: string | void = methodDescriptor.method.apply(this, paramsToCallMethod); + if (typeof (returnCode) !== "undefined") { + this.sendReply(transport.id, transport.src, { + name: transport.message.data.name, + params: { code: returnCode }, + }); + } + } catch (e) { + Log.error(TAG + "Error while executing " + methodDescriptor.methodName + " with error ", e); + if (transport.type === EnumTransport.COMMAND) { + this.sendReply(transport.id, transport.src, { + name: transport.message.data.name, + params: { code: EnumError.UNKNOWN_ERROR }, }); } } @@ -158,8 +171,22 @@ export class MediaChannel extends Channel { * @param options - Options * @returns {EnumError} */ + @MethodToCallByMessage({ + message: EnumMediaMessage.PREPARE, + params: [ + { name: "url", type: String }, + { name: "title", type: String }, + { name: "subtitle", type: String }, + { name: "logo", type: String }, + { name: "mediaType", type: EnumMedia }, + { name: "transferMode", type: EnumTransferMode }, + { name: "autoplay", type: Boolean }, + { name: "frequency", type: Number }, + { name: "options", type: null } + ] + }) public doPrepare(url: string, title: string, subtitle: string, logo: string, mediaType: EnumMedia, - transferMode: EnumTransferMode, autoplay: boolean, frequency: number, options: any): EnumError { + transferMode: EnumTransferMode, autoplay: boolean, frequency: number, options: any): EnumError { Log.debug(TAG + "onPrepare Receives (" + url + "," + title + "," + subtitle + "," + logo + "," + mediaType + "," + transferMode + "," + autoplay + "," + frequency + "," + options); if (!this.medias.hasOwnProperty(mediaType)) { @@ -178,7 +205,16 @@ export class MediaChannel extends Channel { * @param audioTrack * @returns {EnumError} - Error code */ - public doTrack(type: EnumTrack, trackId: string, enabled: boolean, options): EnumError { + @MethodToCallByMessage({ + message: EnumMediaMessage.TRACK, + params: [ + { name: "type", type: EnumTrack }, + { name: "trackId", type: String }, + { name: "enabled", type: Boolean }, + { name: "options", type: null } + ] + }) + public doTrack(type: EnumTrack, trackId: string, enabled: boolean, options: any): EnumError { Log.debug(TAG + "onTrack"); if (!this.media) { return EnumError.NO_PLAYER_INITIALIZED; @@ -192,6 +228,12 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ + @MethodToCallByMessage({ + message: EnumMediaMessage.RESUME, + params: [ + { name: "options", type: null } + ] + }) public doResume(options: any): EnumError { Log.debug(TAG + "onResume"); if (!this.media) { @@ -211,6 +253,12 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ + @MethodToCallByMessage({ + message: EnumMediaMessage.PAUSE, + params: [ + { name: "options", type: null } + ] + }) public doPause(options: any): EnumError { Log.debug(TAG + "onPause"); if (!this.media) { @@ -225,6 +273,12 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ + @MethodToCallByMessage({ + message: EnumMediaMessage.STOP, + params: [ + { name: "options", type: null } + ] + }) public doStop(options: any): EnumError { Log.debug("onStop"); if (!this.media) { @@ -240,6 +294,12 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ + @MethodToCallByMessage({ + message: EnumMediaMessage.CLOSE, + params: [ + { name: "options", type: null } + ] + }) public doClose(options: any): EnumError { Log.debug(TAG + "onClose"); if (!this.media) { @@ -256,7 +316,13 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ - + @MethodToCallByMessage({ + message: EnumMediaMessage.SEEK, + params: [ + { name: "position", type: Number }, + { name: "options", type: null } + ] + }) public doSeek(position: number, options: any): EnumError { Log.debug(TAG + "onSeek"); @@ -274,6 +340,13 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ + @MethodToCallByMessage({ + message: EnumMediaMessage.VOLUME, + params: [ + { name: "volume", type: Number }, + { name: "options", type: null } + ] + }) public doVolume(volume: number, options: any): EnumError { Log.debug(TAG + "onVolume"); if (!this.media) { @@ -290,6 +363,13 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ + @MethodToCallByMessage({ + message: EnumMediaMessage.MUTE, + params: [ + { name: "mute", type: Boolean }, + { name: "options", type: null } + ] + }) public doMute(mute: boolean, options: any): EnumError { Log.debug(TAG + "onMute"); if (!this.media) { @@ -306,6 +386,14 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ + @MethodToCallByMessage({ + message: EnumMediaMessage.GET_PLAYBACK_STATUS, + params: [ + { name: "id", type: Number }, + { name: "src", type: String }, + { name: "options", type: null } + ] + }) public doGetPlaybackStatus(id: number, src: string, options: any) { Log.debug(TAG + "onGetPlaybackStatus" + id + "," + src); if (!this.media) { @@ -313,7 +401,7 @@ export class MediaChannel extends Channel { } let status: any = this.media.getPlaybackStatus(); status.code = EnumError.OK; - this.sendReply(id, src, {name: MediaChannel.EVENTS.PLAYBACK_STATUS, params: status, options}); + this.sendReply(id, src, { name: MediaChannel.EVENTS.PLAYBACK_STATUS, params: status, options }); } /** @@ -323,6 +411,14 @@ export class MediaChannel extends Channel { * @param options * @returns {EnumError} - Error code */ + @MethodToCallByMessage({ + message: EnumMediaMessage.GET_METADATA, + params: [ + { name: "id", type: Number }, + { name: "src", type: String }, + { name: "options", type: null } + ] + }) public doGetMetadata(id: number, src: string, options: any) { Log.debug(TAG + "onGetMetadata " + id + "," + src); if (!this.media) { @@ -330,7 +426,7 @@ export class MediaChannel extends Channel { } let status: any = this.media.getMedatadata(); status.code = EnumError.OK; - this.sendReply(id, src, {name: MediaChannel.EVENTS.METADATA_CHANGED, params: status, options}); + this.sendReply(id, src, { name: MediaChannel.EVENTS.METADATA_CHANGED, params: status, options }); } /** @@ -379,3 +475,47 @@ export class MediaChannel extends Channel { return EnumError.OK; } } + +//Declare annotation +/** + * Annotation to declare a link between a method and a message + * + * @param controlParams Details + */ +function MethodToCallByMessage(controlParams: IMethodToCallByMessage): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void { + return function (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) { + //When a new method is detected, store his declaration + methodsByMessage[controlParams.message] = { + method: descriptor.value, + methodName: propertyKey, + params: controlParams.params + }; + } +} + +//Interfacs to declare links between methods and messages +/** + * Global option given to annotation MethodToCallByMessage. + * This interface describe the link between a method and a message + */ +interface IMethodToCallByMessage { + message: string; + params: IParamWithNameAndType[]; +} + +/** + * Declare type of each parameter + */ +interface IParamWithNameAndType { + name: string, + type: any; +} + +/** + * Store declared link of method/message + */ +interface IMethodWithParams { + method: Function; + methodName: string; + params: IParamWithNameAndType[]; +} \ No newline at end of file diff --git a/src/util/function.helper.ts b/src/util/function.helper.ts deleted file mode 100644 index 22b2a05..0000000 --- a/src/util/function.helper.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2017 Orange - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export class FunctionHelper { - - /** Capitalize first Letter - * @param {string} str - * @returns {string} - Modified String - * @public - */ - public static capitalizeFirstLetter(str): string { - return str.charAt(0).toUpperCase() + str.slice(1); - - } - - /** Return list of parameters for function pass in params - * @param {function} func - * @returns {string} - Modified String - * @private - */ - public static getParamNames(func): string[] { - const fnStr = func.toString().replace(FunctionHelper.STRIP_COMMENTS, ""); - let result = fnStr.slice(fnStr.indexOf("(") + 1, fnStr.indexOf(")")).match(FunctionHelper.ARGUMENT_NAMES); - if (result === null) { - result = []; - } - return result; - } - - private static STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; - private static ARGUMENT_NAMES = /([^\s,]+)/g; -} diff --git a/test/util.function.helper.spec.ts b/test/util.function.helper.spec.ts deleted file mode 100644 index b2147fa..0000000 --- a/test/util.function.helper.spec.ts +++ /dev/null @@ -1,35 +0,0 @@ -import assert = require("assert"); -import chai = require("chai"); -import {FunctionHelper} from "../src/util/function.helper"; -const expect = chai.expect; - -describe("FunctionHelper", () => { - describe("capitalizeFirstLetter", () => { - it("Should return a String with first letter capitalize", () => { - assert.equal(FunctionHelper.capitalizeFirstLetter("test"), "Test"); - assert.equal(FunctionHelper.capitalizeFirstLetter("Test"), "Test"); - }); - }); - describe("getParamNames", () => { - it("Should return a list of parameters for a function with two parameters", () => { - let dummyFunction = (param1, param2) => { - let dummy = true; - }; - assert.deepEqual(FunctionHelper.getParamNames(dummyFunction), ["param1", "param2"]); - }); - - it("Should return a list of parameters for a function with two typed parameters", () => { - let dummyFunction = (param1: string, param2: any) => { - let dummy = true; - }; - assert.deepEqual(FunctionHelper.getParamNames(dummyFunction), ["param1", "param2"]); - }); - - it("Should return a empty list of parameters for a function without parameters", () => { - let dummyFunction = () => { - let dummy = true; - }; - assert.deepEqual(FunctionHelper.getParamNames(dummyFunction), []); - }); - }); -}); From f5f44e36b3601df8b3f97fa83cfcffa62ab6cdbf Mon Sep 17 00:00:00 2001 From: GERMA Delphin Ext IMT/OLS Date: Fri, 20 Jul 2018 11:57:38 +0200 Subject: [PATCH 10/13] fix: tslint corrections --- src/channel/enum.media.messages.ts | 5 +- src/channel/media.channel.ts | 78 +++++++++++++++--------------- src/i-ocast-init.ts | 3 +- src/ocast.ts | 6 ++- tslint.json | 4 +- 5 files changed, 50 insertions(+), 46 deletions(-) diff --git a/src/channel/enum.media.messages.ts b/src/channel/enum.media.messages.ts index 0788713..b3c6575 100644 --- a/src/channel/enum.media.messages.ts +++ b/src/channel/enum.media.messages.ts @@ -1,3 +1,4 @@ + export enum EnumMediaMessage { PAUSE = "pause", RESUME = "resume", @@ -9,5 +10,5 @@ export enum EnumMediaMessage { GET_PLAYBACK_STATUS = "getPlaybackStatus", GET_METADATA = "getMetadata", MUTE = "mute", - PREPARE = "prepare" -} \ No newline at end of file + PREPARE = "prepare", +}; diff --git a/src/channel/media.channel.ts b/src/channel/media.channel.ts index 0544cfb..de1c510 100644 --- a/src/channel/media.channel.ts +++ b/src/channel/media.channel.ts @@ -28,14 +28,14 @@ import {EnumTransferMode} from "../type/enum.transfermode"; import {EnumTransport} from "../type/enum.transport"; import {Logger} from "../util/logger"; import {Channel} from "./channel"; +import {EnumMediaMessage} from "./enum.media.messages"; import {IMediaNotifier} from "./media.notifier"; -import {EnumMediaMessage} from './enum.media.messages'; const TAG: string = " [MediaChannel] "; const Log: Logger = Logger.getInstance(); -//Manage annotations to call methods by transport message -//Store all methods/message type +// Manage annotations to call methods by transport message +// Store all methods/message type const methodsByMessage: { [key: string]: IMethodWithParams } = {}; /** @@ -84,11 +84,10 @@ export class MediaChannel extends Channel { /** * Implements specific parsing for this channel - * * @param {Transport} transport - Message to send */ public onMessage(transport: Transport): void { - //Check if message is supported + // Check if message is supported if (!methodsByMessage[transport.message.data.name]) { Log.error(TAG + "Message type '" + transport.message.data.name + "' unknown"); if (transport.type === EnumTransport.COMMAND) { @@ -100,7 +99,7 @@ export class MediaChannel extends Channel { return; } - //Explode message to call method + // Explode message to call method const methodDescriptor: IMethodWithParams = methodsByMessage[transport.message.data.name]; const paramsToCallMethod: any[] = []; const paramsMessage: {} = transport.message.data.params || {}; @@ -126,7 +125,7 @@ export class MediaChannel extends Channel { } }); - //Check if all params are ok + // Check if all params are ok if (!validate) { Log.error(TAG + "Error while executing " + methodDescriptor.methodName + " paramters missing)"); if (transport.type === EnumTransport.COMMAND) { @@ -138,7 +137,7 @@ export class MediaChannel extends Channel { return; } - //All params are ok, call method + // All params are ok, call method try { const returnCode: string | void = methodDescriptor.method.apply(this, paramsToCallMethod); if (typeof (returnCode) !== "undefined") { @@ -182,8 +181,8 @@ export class MediaChannel extends Channel { { name: "transferMode", type: EnumTransferMode }, { name: "autoplay", type: Boolean }, { name: "frequency", type: Number }, - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doPrepare(url: string, title: string, subtitle: string, logo: string, mediaType: EnumMedia, transferMode: EnumTransferMode, autoplay: boolean, frequency: number, options: any): EnumError { @@ -211,8 +210,8 @@ export class MediaChannel extends Channel { { name: "type", type: EnumTrack }, { name: "trackId", type: String }, { name: "enabled", type: Boolean }, - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doTrack(type: EnumTrack, trackId: string, enabled: boolean, options: any): EnumError { Log.debug(TAG + "onTrack"); @@ -231,8 +230,8 @@ export class MediaChannel extends Channel { @MethodToCallByMessage({ message: EnumMediaMessage.RESUME, params: [ - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doResume(options: any): EnumError { Log.debug(TAG + "onResume"); @@ -256,8 +255,8 @@ export class MediaChannel extends Channel { @MethodToCallByMessage({ message: EnumMediaMessage.PAUSE, params: [ - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doPause(options: any): EnumError { Log.debug(TAG + "onPause"); @@ -276,8 +275,8 @@ export class MediaChannel extends Channel { @MethodToCallByMessage({ message: EnumMediaMessage.STOP, params: [ - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doStop(options: any): EnumError { Log.debug("onStop"); @@ -297,8 +296,8 @@ export class MediaChannel extends Channel { @MethodToCallByMessage({ message: EnumMediaMessage.CLOSE, params: [ - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doClose(options: any): EnumError { Log.debug(TAG + "onClose"); @@ -320,8 +319,8 @@ export class MediaChannel extends Channel { message: EnumMediaMessage.SEEK, params: [ { name: "position", type: Number }, - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doSeek(position: number, options: any): EnumError { @@ -344,8 +343,8 @@ export class MediaChannel extends Channel { message: EnumMediaMessage.VOLUME, params: [ { name: "volume", type: Number }, - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doVolume(volume: number, options: any): EnumError { Log.debug(TAG + "onVolume"); @@ -367,8 +366,8 @@ export class MediaChannel extends Channel { message: EnumMediaMessage.MUTE, params: [ { name: "mute", type: Boolean }, - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doMute(mute: boolean, options: any): EnumError { Log.debug(TAG + "onMute"); @@ -391,8 +390,8 @@ export class MediaChannel extends Channel { params: [ { name: "id", type: Number }, { name: "src", type: String }, - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doGetPlaybackStatus(id: number, src: string, options: any) { Log.debug(TAG + "onGetPlaybackStatus" + id + "," + src); @@ -416,8 +415,8 @@ export class MediaChannel extends Channel { params: [ { name: "id", type: Number }, { name: "src", type: String }, - { name: "options", type: null } - ] + { name: "options", type: null }, + ], }) public doGetMetadata(id: number, src: string, options: any) { Log.debug(TAG + "onGetMetadata " + id + "," + src); @@ -476,24 +475,23 @@ export class MediaChannel extends Channel { } } -//Declare annotation +// Declare annotation /** * Annotation to declare a link between a method and a message - * * @param controlParams Details */ -function MethodToCallByMessage(controlParams: IMethodToCallByMessage): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void { - return function (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) { - //When a new method is detected, store his declaration +function MethodToCallByMessage(controlParams: IMethodToCallByMessage): Function { + return (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => { + // When a new method is detected, store his declaration methodsByMessage[controlParams.message] = { method: descriptor.value, methodName: propertyKey, - params: controlParams.params + params: controlParams.params, }; - } + }; } -//Interfacs to declare links between methods and messages +// Interfacs to declare links between methods and messages /** * Global option given to annotation MethodToCallByMessage. * This interface describe the link between a method and a message @@ -507,7 +505,7 @@ interface IMethodToCallByMessage { * Declare type of each parameter */ interface IParamWithNameAndType { - name: string, + name: string; type: any; } @@ -518,4 +516,4 @@ interface IMethodWithParams { method: Function; methodName: string; params: IParamWithNameAndType[]; -} \ No newline at end of file +} diff --git a/src/i-ocast-init.ts b/src/i-ocast-init.ts index 3435206..9eb7bcd 100644 --- a/src/i-ocast-init.ts +++ b/src/i-ocast-init.ts @@ -1,4 +1,5 @@ + export interface IOcastInit { webSocketProtocol?: string; webSocketPort?: number; -} \ No newline at end of file +} diff --git a/src/ocast.ts b/src/ocast.ts index 0cdc55c..900c6fb 100755 --- a/src/ocast.ts +++ b/src/ocast.ts @@ -17,13 +17,13 @@ import { Channel } from "./channel/channel"; import { MediaChannel } from "./channel/media.channel"; import { WebappChannel } from "./channel/webapp.channel"; +import { IOcastInit } from "./i-ocast-init"; import { Transport } from "./protocol/transport"; import { TransportMessage } from "./protocol/transport.message"; import { EnumError } from "./type/enum.error"; import { EnumProtocol } from "./type/enum.protocol"; import { EnumTransport } from "./type/enum.transport"; import { Logger } from "./util/logger"; -import { IOcastInit } from "./i-ocast-init"; const TAG: string = " [OCast] "; const Log: Logger = Logger.getInstance(); @@ -54,7 +54,9 @@ export class OCast { * @public */ public start() { - this.ws = new WebSocket(this.initParameters.webSocketProtocol + EnumProtocol.HOST + ":" + this.initParameters.webSocketPort + EnumProtocol.PATH); + const url = this.initParameters.webSocketProtocol + EnumProtocol.HOST + ":" + + this.initParameters.webSocketPort + EnumProtocol.PATH; + this.ws = new WebSocket(url); this.ws.onopen = this.onConnected.bind(this); this.ws.onmessage = this.onMessage.bind(this); this.ws.onerror = this.onError.bind(this); diff --git a/tslint.json b/tslint.json index bfb99ec..59d4a22 100644 --- a/tslint.json +++ b/tslint.json @@ -4,6 +4,8 @@ "tslint:recommended" ], "jsRules": {}, - "rules": {}, + "rules": { + "align": false + }, "rulesDirectory": [] } From 83147bad1e94ae1851bbb3813a23fe62b443d1f2 Mon Sep 17 00:00:00 2001 From: GERMA Delphin Ext IMT/OLS Date: Fri, 20 Jul 2018 12:07:41 +0200 Subject: [PATCH 11/13] fix: Correction on a test --- test/.ocast.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/.ocast.spec.ts b/test/.ocast.spec.ts index 4fd69c9..2441155 100755 --- a/test/.ocast.spec.ts +++ b/test/.ocast.spec.ts @@ -21,7 +21,7 @@ const client = d2r.client; let ocast: OCast = new OCast({ webSocketPort: 4434, - webSocketProtocol: "wss://" + webSocketProtocol: "ws://", }); let dummyVideoPlayer: VideoPlayer = new VideoPlayer(); From 006b18ecef58f8cc14c32313ce8128c699da2463 Mon Sep 17 00:00:00 2001 From: GERMA Delphin Ext IMT/OLS Date: Fri, 20 Jul 2018 14:15:21 +0200 Subject: [PATCH 12/13] refactor: Remove useless enums/interface --- src/channel/channel.ts | 3 +-- src/channel/webapp.channel.ts | 2 -- src/i-ocast-init.ts | 5 ----- src/ocast.ts | 12 ++---------- src/type/enum.protocol.ts | 27 --------------------------- test/.ocast.spec.ts | 5 +---- test/channel.channel.spec.ts | 5 +---- test/channel.mediachannel.spec.ts | 5 +---- 8 files changed, 6 insertions(+), 58 deletions(-) delete mode 100644 src/i-ocast-init.ts delete mode 100644 src/type/enum.protocol.ts diff --git a/src/channel/channel.ts b/src/channel/channel.ts index 5402394..bf450f7 100644 --- a/src/channel/channel.ts +++ b/src/channel/channel.ts @@ -18,7 +18,6 @@ import {OCast} from "../ocast"; import {Transport} from "../protocol/transport"; import {TransportMessage} from "../protocol/transport.message"; import {EnumError} from "../type/enum.error"; -import {EnumProtocol} from "../type/enum.protocol"; import {EnumTransport} from "../type/enum.transport"; import {Logger} from "../util/logger"; @@ -65,7 +64,7 @@ export class Channel { */ protected sendReply(id: number, dst: string, data: any) { const message = new Transport(UUID, dst, EnumTransport.REPLY, id, new TransportMessage(this.name, data)); - message.setStatus(EnumProtocol.OK_STATUS as string); + message.setStatus("OK"); Log.debug(TAG + "sendReply : " + JSON.stringify(message)); this.sendMessage(message); } diff --git a/src/channel/webapp.channel.ts b/src/channel/webapp.channel.ts index 2e0f373..6dd0c8a 100644 --- a/src/channel/webapp.channel.ts +++ b/src/channel/webapp.channel.ts @@ -14,8 +14,6 @@ * limitations under the License. */ -import {OCast} from "../ocast"; -import {EnumProtocol} from "../type/enum.protocol"; import {Logger} from "../util/logger"; import {Channel} from "./channel"; diff --git a/src/i-ocast-init.ts b/src/i-ocast-init.ts deleted file mode 100644 index 9eb7bcd..0000000 --- a/src/i-ocast-init.ts +++ /dev/null @@ -1,5 +0,0 @@ - -export interface IOcastInit { - webSocketProtocol?: string; - webSocketPort?: number; -} diff --git a/src/ocast.ts b/src/ocast.ts index 900c6fb..4698cd4 100755 --- a/src/ocast.ts +++ b/src/ocast.ts @@ -17,11 +17,9 @@ import { Channel } from "./channel/channel"; import { MediaChannel } from "./channel/media.channel"; import { WebappChannel } from "./channel/webapp.channel"; -import { IOcastInit } from "./i-ocast-init"; import { Transport } from "./protocol/transport"; import { TransportMessage } from "./protocol/transport.message"; import { EnumError } from "./type/enum.error"; -import { EnumProtocol } from "./type/enum.protocol"; import { EnumTransport } from "./type/enum.transport"; import { Logger } from "./util/logger"; @@ -35,18 +33,14 @@ export class OCast { public debug = false; private ws: WebSocket = null; private channels: Channel[] = []; - private initParameters: IOcastInit = null; /** * OCast Root Object, create default channel 'webapp' and 'media' * @constructor */ - constructor(initParameters?: IOcastInit) { + constructor(private url: string = "wss://localhost:4433/ocast") { this.setupMediaChannel(); this.setupWebappChannel(); - this.initParameters = initParameters || {}; - this.initParameters.webSocketProtocol = this.initParameters.webSocketProtocol || EnumProtocol.PROTOCOL; - this.initParameters.webSocketPort = this.initParameters.webSocketPort || EnumProtocol.PORT; } /** @@ -54,9 +48,7 @@ export class OCast { * @public */ public start() { - const url = this.initParameters.webSocketProtocol + EnumProtocol.HOST + ":" + - this.initParameters.webSocketPort + EnumProtocol.PATH; - this.ws = new WebSocket(url); + this.ws = new WebSocket(this.url); this.ws.onopen = this.onConnected.bind(this); this.ws.onmessage = this.onMessage.bind(this); this.ws.onerror = this.onError.bind(this); diff --git a/src/type/enum.protocol.ts b/src/type/enum.protocol.ts deleted file mode 100644 index 752fa3b..0000000 --- a/src/type/enum.protocol.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2017 Orange - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Base Protocol Enum - */ -export enum EnumProtocol { - /** test protocol */ - PROTOCOL = "wss://", - PORT = 4433, - HOST = "localhost", - PATH = "/ocast", - OK_STATUS = "OK", -} diff --git a/test/.ocast.spec.ts b/test/.ocast.spec.ts index 2441155..0bdceea 100755 --- a/test/.ocast.spec.ts +++ b/test/.ocast.spec.ts @@ -19,10 +19,7 @@ global['WebSocket'] = WebSocket; const broker = d2r.broker; const client = d2r.client; -let ocast: OCast = new OCast({ - webSocketPort: 4434, - webSocketProtocol: "ws://", -}); +let ocast: OCast = new OCast("ws://localhost:4434/ocast"); let dummyVideoPlayer: VideoPlayer = new VideoPlayer(); const Log: Logger = Logger.getInstance(); diff --git a/test/channel.channel.spec.ts b/test/channel.channel.spec.ts index bcc35b4..f1914b1 100644 --- a/test/channel.channel.spec.ts +++ b/test/channel.channel.spec.ts @@ -17,10 +17,7 @@ global['WebSocket'] = WebSocket; const broker = d2r.broker; const client = d2r.client; -let ocast: OCast = new OCast({ - webSocketPort: 4434, - webSocketProtocol: "ws://" -}); +let ocast: OCast = new OCast("ws://localhost:4434/ocast"); const Log: Logger = Logger.getInstance(); diff --git a/test/channel.mediachannel.spec.ts b/test/channel.mediachannel.spec.ts index 40bf61e..4275efd 100644 --- a/test/channel.mediachannel.spec.ts +++ b/test/channel.mediachannel.spec.ts @@ -20,10 +20,7 @@ import {ImagePlayer} from "./mock/image.player"; const broker = d2r.broker; const client = d2r.client; -let ocast: OCast = new OCast({ - webSocketPort: 4434, - webSocketProtocol: "ws://" -}); +let ocast: OCast = new OCast("ws://localhost:4434/ocast"); let dummyVideoPlayer: VideoPlayer = new VideoPlayer(); let dummyImagePlayer: ImagePlayer = new ImagePlayer(); let sequenceId: number = 4; From beefeb14a85a05741ff69230455663e7dc894391 Mon Sep 17 00:00:00 2001 From: GERMA Delphin Ext IMT/OLS Date: Fri, 20 Jul 2018 14:18:35 +0200 Subject: [PATCH 13/13] chore: Add test dependencies --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0aaf679..e06170f 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@types/ws": "^3.0.2", "babel-plugin-external-helpers": "^6.22.0", "babel-preset-es2015": "^6.24.1", + "chai": "^4.1.2", "commitizen": "^2.9.6", "cz-conventional-changelog": "^2.1.0", "istanbul": "^0.4.5", @@ -56,7 +57,8 @@ "ts-node": "^3.3.0", "tslint": "^4.5.1", "typedoc": "^0.8.0", - "typescript": "^2.4.2" + "typescript": "^2.4.2", + "ws": "^5.2.2" }, "nyc": { "include": [ @@ -75,4 +77,3 @@ "instrument": true } } -