From bdcb90ec5673e6dc7eda08ba9b30c4b0bf62d466 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Wed, 24 Jan 2018 14:13:29 -0800 Subject: [PATCH 1/5] adding type definitions. --- package-lock.json | 2115 +++++++++++++++++ package.json | 127 +- tsconfig.json | 6 + typings/lib/adapters/translate_encoder.d.ts | 8 + typings/lib/amqp_client.d.ts | 134 ++ typings/lib/connection.d.ts | 167 ++ typings/lib/constants.d.ts | 80 + typings/lib/errors.d.ts | 122 + typings/lib/frames.d.ts | 122 + typings/lib/index.d.ts | 91 + typings/lib/link.d.ts | 83 + typings/lib/policies/activemq_policy.d.ts | 8 + typings/lib/policies/event_hub_policy.d.ts | 8 + typings/lib/policies/policy.d.ts | 151 ++ typings/lib/policies/policy_utilities.d.ts | 38 + typings/lib/policies/qpid_java_policy.d.ts | 10 + typings/lib/policies/service_bus_policy.d.ts | 9 + .../policies/service_bus_queue_policy.d.ts | 8 + .../policies/service_bus_topic_policy.d.ts | 8 + typings/lib/receiver_link.d.ts | 104 + typings/lib/sender_link.d.ts | 61 + typings/lib/session.d.ts | 121 + typings/lib/streams/receiver_stream.d.ts | 10 + typings/lib/streams/sender_stream.d.ts | 10 + typings/lib/transport/abstract_transport.d.ts | 18 + typings/lib/transport/index.d.ts | 31 + typings/lib/transport/net_transport.d.ts | 18 + typings/lib/transport/tls_transport.d.ts | 18 + typings/lib/types/composite_type.d.ts | 55 + typings/lib/types/delivery_state.d.ts | 50 + typings/lib/types/described_type.d.ts | 51 + typings/lib/types/forced_type.d.ts | 24 + 32 files changed, 3804 insertions(+), 62 deletions(-) create mode 100644 package-lock.json create mode 100644 tsconfig.json create mode 100644 typings/lib/adapters/translate_encoder.d.ts create mode 100644 typings/lib/amqp_client.d.ts create mode 100644 typings/lib/connection.d.ts create mode 100644 typings/lib/constants.d.ts create mode 100644 typings/lib/errors.d.ts create mode 100644 typings/lib/frames.d.ts create mode 100644 typings/lib/index.d.ts create mode 100644 typings/lib/link.d.ts create mode 100644 typings/lib/policies/activemq_policy.d.ts create mode 100644 typings/lib/policies/event_hub_policy.d.ts create mode 100644 typings/lib/policies/policy.d.ts create mode 100644 typings/lib/policies/policy_utilities.d.ts create mode 100644 typings/lib/policies/qpid_java_policy.d.ts create mode 100644 typings/lib/policies/service_bus_policy.d.ts create mode 100644 typings/lib/policies/service_bus_queue_policy.d.ts create mode 100644 typings/lib/policies/service_bus_topic_policy.d.ts create mode 100644 typings/lib/receiver_link.d.ts create mode 100644 typings/lib/sender_link.d.ts create mode 100644 typings/lib/session.d.ts create mode 100644 typings/lib/streams/receiver_stream.d.ts create mode 100644 typings/lib/streams/sender_stream.d.ts create mode 100644 typings/lib/transport/abstract_transport.d.ts create mode 100644 typings/lib/transport/index.d.ts create mode 100644 typings/lib/transport/net_transport.d.ts create mode 100644 typings/lib/transport/tls_transport.d.ts create mode 100644 typings/lib/types/composite_type.d.ts create mode 100644 typings/lib/types/delivery_state.d.ts create mode 100644 typings/lib/types/described_type.d.ts create mode 100644 typings/lib/types/forced_type.d.ts diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..cb2ab65 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2115 @@ +{ + "name": "amqp10", + "version": "3.5.4", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.3.0.tgz", + "integrity": "sha512-wNBfvNjzsJl4tswIZKXCFQY0lss9nKUyJnG6T94X/eqjRgI2jHZ4evdjhQYBSan/vGtF6XVXPApOmNH2rf0KKw==" + }, + "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", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "add-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", + "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "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-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", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "babylon": { + "version": "7.0.0-beta.19", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", + "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "requires": { + "lodash": "4.17.4", + "platform": "1.3.5" + } + }, + "bl": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz", + "integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=", + "requires": { + "readable-stream": "2.3.3" + } + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "buffer-builder": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/buffer-builder/-/buffer-builder-0.2.0.tgz", + "integrity": "sha1-MyLNMH2Cltqx9gRhhZOyYaP63o8=" + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, + "catharsis": { + "version": "0.8.9", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", + "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", + "dev": true, + "requires": { + "underscore-contrib": "0.3.0" + } + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chai": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", + "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", + "dev": true, + "requires": { + "assertion-error": "1.1.0", + "deep-eql": "0.1.3", + "type-detect": "1.0.0" + } + }, + "chai-as-promised": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-6.0.0.tgz", + "integrity": "sha1-GgKkM6byTa+sY7nJb6FoTbGqjaY=", + "dev": true, + "requires": { + "check-error": "1.0.2" + } + }, + "chai-string": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.4.0.tgz", + "integrity": "sha1-NZFAwFHTak5LGl/GuRAVL0OKjUk=", + "dev": true + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "requires": { + "exit": "0.1.2", + "glob": "7.1.2" + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "collections": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/collections/-/collections-0.2.2.tgz", + "integrity": "sha1-HyMCay7zb5J+7MkB6ZxfDUj6M04=", + "dev": true, + "requires": { + "weak-map": "1.0.0" + } + }, + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "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" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } + }, + "conventional-changelog": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-1.1.7.tgz", + "integrity": "sha1-kVGmKx2O2y2CcR2r9bfPcQQfgrE=", + "dev": true, + "requires": { + "conventional-changelog-angular": "1.6.0", + "conventional-changelog-atom": "0.1.2", + "conventional-changelog-codemirror": "0.2.1", + "conventional-changelog-core": "1.9.5", + "conventional-changelog-ember": "0.2.10", + "conventional-changelog-eslint": "0.2.1", + "conventional-changelog-express": "0.2.1", + "conventional-changelog-jquery": "0.1.0", + "conventional-changelog-jscs": "0.1.0", + "conventional-changelog-jshint": "0.2.1" + } + }, + "conventional-changelog-angular": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.0.tgz", + "integrity": "sha1-CiagcfLJ/PzyuGugz79uYwG3W/o=", + "dev": true, + "requires": { + "compare-func": "1.3.2", + "q": "1.5.1" + } + }, + "conventional-changelog-atom": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-0.1.2.tgz", + "integrity": "sha1-Ella1SZ6aTfDTPkAKBscZRmKTGM=", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "conventional-changelog-cli": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-1.3.5.tgz", + "integrity": "sha1-RsUUliFrdAZYiIPe+m+sWJ6bsx4=", + "dev": true, + "requires": { + "add-stream": "1.0.0", + "conventional-changelog": "1.1.7", + "lodash": "4.17.4", + "meow": "3.7.0", + "tempfile": "1.1.1" + } + }, + "conventional-changelog-codemirror": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.2.1.tgz", + "integrity": "sha1-KZpPcUe681DmyBWPxUlUopHFzAk=", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "conventional-changelog-core": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-1.9.5.tgz", + "integrity": "sha1-XbdWba18DLddr0f7spdve/mSjB0=", + "dev": true, + "requires": { + "conventional-changelog-writer": "2.0.3", + "conventional-commits-parser": "2.1.0", + "dateformat": "1.0.12", + "get-pkg-repo": "1.4.0", + "git-raw-commits": "1.3.0", + "git-remote-origin-url": "2.0.0", + "git-semver-tags": "1.2.3", + "lodash": "4.17.4", + "normalize-package-data": "2.4.0", + "q": "1.5.1", + "read-pkg": "1.1.0", + "read-pkg-up": "1.0.1", + "through2": "2.0.3" + } + }, + "conventional-changelog-ember": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-0.2.10.tgz", + "integrity": "sha512-LBBBZO6Q7ib4HhSdyCNVR25OtaXl710UJg1aSHCLmR8AjuXKs3BO8tnbY1MH+D1C+z5IFoEDkpjOddefNTyhCQ==", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "conventional-changelog-eslint": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-0.2.1.tgz", + "integrity": "sha1-LCoRvrIW+AZJunKDQYApO2h8BmI=", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "conventional-changelog-express": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-0.2.1.tgz", + "integrity": "sha1-g42eHmyQmXA7FQucGaoteBdCvWw=", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "conventional-changelog-jquery": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz", + "integrity": "sha1-Agg5cWLjhGmG5xJztsecW1+A9RA=", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "conventional-changelog-jscs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz", + "integrity": "sha1-BHnrRDzH1yxYvwvPDvHURKkvDlw=", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "conventional-changelog-jshint": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-0.2.1.tgz", + "integrity": "sha1-hhObs6yZiZ8rF36WF+CbN9mbzzo=", + "dev": true, + "requires": { + "compare-func": "1.3.2", + "q": "1.5.1" + } + }, + "conventional-changelog-writer": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-2.0.3.tgz", + "integrity": "sha512-2E1h7UXL0fhRO5h0CxDZ5EBc5sfBZEQePvuZ+gPvApiRrICUyNDy/NQIP+2TBd4wKZQf2Zm7TxbzXHG5HkPIbA==", + "dev": true, + "requires": { + "compare-func": "1.3.2", + "conventional-commits-filter": "1.1.1", + "dateformat": "1.0.12", + "handlebars": "4.0.11", + "json-stringify-safe": "5.0.1", + "lodash": "4.17.4", + "meow": "3.7.0", + "semver": "5.5.0", + "split": "1.0.1", + "through2": "2.0.3" + } + }, + "conventional-commits-filter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-1.1.1.tgz", + "integrity": "sha512-bQyatySNKHhcaeKVr9vFxYWA1W1Tdz6ybVMYDmv4/FhOXY1+fchiW07TzRbIQZhVa4cvBwrEaEUQBbCncFSdJQ==", + "dev": true, + "requires": { + "is-subset": "0.1.1", + "modify-values": "1.0.0" + } + }, + "conventional-commits-parser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.0.tgz", + "integrity": "sha512-8MD05yN0Zb6aRsZnFX1ET+8rHWfWJk+my7ANCJZBU2mhz7TSB1fk2vZhkrwVy/PCllcTYAP/1T1NiWQ7Z01mKw==", + "dev": true, + "requires": { + "JSONStream": "1.3.2", + "is-text-path": "1.0.1", + "lodash": "4.17.4", + "meow": "3.7.0", + "split2": "2.2.0", + "through2": "2.0.3", + "trim-off-newlines": "1.0.1" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "1.0.2" + } + }, + "dargs": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", + "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "dev": true, + "requires": { + "get-stdin": "4.0.1", + "meow": "3.7.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "dev": true, + "requires": { + "type-detect": "0.1.1" + }, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", + "dev": true + } + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "dev": true + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "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" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "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" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" + }, + "dependencies": { + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-pkg-repo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", + "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "meow": "3.7.0", + "normalize-package-data": "2.4.0", + "parse-github-repo-url": "1.4.1", + "through2": "2.0.3" + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "gh-pages": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-0.12.0.tgz", + "integrity": "sha1-2VHj7Zi4VpnUsEGOsaFbGgSYjcE=", + "dev": true, + "requires": { + "async": "2.1.2", + "commander": "2.9.0", + "globby": "6.1.0", + "graceful-fs": "4.1.10", + "q": "1.4.1", + "q-io": "1.13.2", + "rimraf": "2.6.2" + }, + "dependencies": { + "async": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.1.2.tgz", + "integrity": "sha1-YSpKtF70KnDN6Aa62G7m2wR+g4U=", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "graceful-fs": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.10.tgz", + "integrity": "sha1-8tcgwiCS90Mih3XHXjYSYyUB8TE=", + "dev": true + }, + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "dev": true + } + } + }, + "git-raw-commits": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.0.tgz", + "integrity": "sha1-C8hZbpDV/+c29/VUa9LRL3OrqsY=", + "dev": true, + "requires": { + "dargs": "4.1.0", + "lodash.template": "4.4.0", + "meow": "3.7.0", + "split2": "2.2.0", + "through2": "2.0.3" + } + }, + "git-remote-origin-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", + "dev": true, + "requires": { + "gitconfiglocal": "1.0.0", + "pify": "2.3.0" + } + }, + "git-semver-tags": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.2.3.tgz", + "integrity": "sha1-GItFOIK/nXojr9Mbq6U32rc4jV0=", + "dev": true, + "requires": { + "meow": "3.7.0", + "semver": "5.5.0" + } + }, + "gitconfiglocal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", + "dev": true, + "requires": { + "ini": "1.3.5" + } + }, + "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" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.3.0", + "domutils": "1.5.1", + "entities": "1.0.0", + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "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-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-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, + "requires": { + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.0.11", + "js-yaml": "3.10.0", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.2.3", + "which": "1.3.0", + "wordwrap": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + } + } + }, + "js2xmlparser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", + "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", + "dev": true, + "requires": { + "xmlcreate": "1.0.2" + } + }, + "jsdoc": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", + "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", + "dev": true, + "requires": { + "babylon": "7.0.0-beta.19", + "bluebird": "3.5.1", + "catharsis": "0.8.9", + "escape-string-regexp": "1.0.5", + "js2xmlparser": "3.0.0", + "klaw": "2.0.0", + "marked": "0.3.12", + "mkdirp": "0.5.1", + "requizzle": "0.2.1", + "strip-json-comments": "2.0.1", + "taffydb": "2.6.2", + "underscore": "1.8.3" + } + }, + "jshint": { + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", + "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", + "dev": true, + "requires": { + "cli": "1.0.1", + "console-browserify": "1.1.0", + "exit": "0.1.2", + "htmlparser2": "3.8.3", + "lodash": "3.7.0", + "minimatch": "3.0.4", + "shelljs": "0.3.0", + "strip-json-comments": "1.0.4" + }, + "dependencies": { + "lodash": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz", + "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=", + "dev": true + }, + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true + } + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "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", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "klaw": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", + "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "dev": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash.keys": "3.1.2" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basecreate": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash.create": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "dev": true, + "requires": { + "lodash._baseassign": "3.2.0", + "lodash._basecreate": "3.0.3", + "lodash._isiterateecall": "3.0.9" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.template": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.templatesettings": "4.1.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0" + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "marked": { + "version": "0.3.12", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.12.tgz", + "integrity": "sha512-k4NaW+vS7ytQn6MgJn3fYpQt20/mOgYM5Ft9BYMfQJDz2QT6yEeS9XJ8k2Nw8JTeWK/znPPW2n3UJGzyYEiMoA==", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mimeparse": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/mimeparse/-/mimeparse-0.1.4.tgz", + "integrity": "sha1-2vsCdSNw/SJgk64xUsJxrwGsJUo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.1", + "growl": "1.9.2", + "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", + "mkdirp": "0.5.1", + "supports-color": "3.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "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" + } + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "modify-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.0.tgz", + "integrity": "sha1-4rbN65zhn5kxelNyLz2/XfXqqrI=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=" + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1.0.9" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "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 + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "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 + }, + "parse-github-repo-url": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", + "integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "platform": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.5.tgz", + "integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "q-io": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/q-io/-/q-io-1.13.2.tgz", + "integrity": "sha1-7qEw1IHdteGqG8WmaFX3OR0G8AM=", + "dev": true, + "requires": { + "collections": "0.2.2", + "mime": "1.6.0", + "mimeparse": "0.1.4", + "q": "1.5.1", + "qs": "1.2.2", + "url2": "0.0.0" + } + }, + "qmf2": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/qmf2/-/qmf2-0.1.5.tgz", + "integrity": "sha1-ghmm90tPPNlAsTqANl1w4bpg/co=", + "dev": true, + "requires": { + "bluebird": "3.5.1", + "debug": "2.6.9", + "uuid": "2.0.3" + } + }, + "qs": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", + "integrity": "sha1-GbV/8k3CqZzh+L32r82ln472H4g=", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + } + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "requizzle": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", + "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", + "dev": true, + "requires": { + "underscore": "1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "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" + } + }, + "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", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stately.js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/stately.js/-/stately.js-1.3.0.tgz", + "integrity": "sha1-UtDRwVKgaaZ8sUUDrF3c24vh13c=" + }, + "stream-buffers": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-3.0.1.tgz", + "integrity": "sha1-aKOMX6re3tef95mI02jj+xMl7wY=", + "dev": true + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", + "dev": true + }, + "tempfile": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tempfile/-/tempfile-1.1.1.tgz", + "integrity": "sha1-W8xOrsxKsscH2LwR2ZzMmiyyh/I=", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2", + "uuid": "2.0.3" + } + }, + "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", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "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 + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "dev": true + }, + "underscore-contrib": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", + "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", + "dev": true, + "requires": { + "underscore": "1.6.0" + }, + "dependencies": { + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + } + } + }, + "url2": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/url2/-/url2-0.0.0.tgz", + "integrity": "sha1-Tqq9HVw6yQ1iq0SFyZhCKGWgSxo=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", + "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "weak-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/weak-map/-/weak-map-1.0.0.tgz", + "integrity": "sha1-tm5Wqd8L0lp2u/G1FNsSkIBhSjc=", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xmlcreate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", + "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + } + } + } + } +} diff --git a/package.json b/package.json index 7abeeb1..236b71d 100644 --- a/package.json +++ b/package.json @@ -1,62 +1,65 @@ -{ - "name": "amqp10", - "version": "3.5.4", - "description": "Native AMQP-1.0 client for node.js", - "main": "./lib", - "engines": { - "node": ">= 0.10" - }, - "dependencies": { - "bl": "^1.1.2", - "bluebird": "^3.4.6", - "buffer-builder": "^0.2.0", - "debug": "^2.3.3", - "lodash": "^4.17.2", - "node-int64": "^0.4.0", - "stately.js": "^1.3.0" - }, - "devDependencies": { - "benchmark": "^2.1.2", - "chai": "^3.5.0", - "chai-as-promised": "^6.0.0", - "chai-string": "^1.3.0", - "conventional-changelog-cli": "^1.2.0", - "gh-pages": "^0.12.0", - "istanbul": "^0.4.5", - "jsdoc": "^3.4.2", - "jshint": "^2.9.4", - "mocha": "^3.2.0", - "qmf2": "^0.1.5", - "semver": "^5.4.1", - "stream-buffers": "^3.0.1" - }, - "scripts": { - "version": "make changelog && git add CHANGELOG.md && make docs" - }, - "author": { - "name": "noodlefrenzy", - "email": "milanz@microsoft.com", - "url": "http://www.mikelanzetta.com" - }, - "contributors": [ - { - "name": "mbroadst", - "email": "mbroadst@gmail.com", - "url": "https://github.com/mbroadst" - } - ], - "homepage": "https://github.com/noodlefrenzy/node-amqp10", - "license": "MIT", - "keywords": [ - "amqp", - "amqp 1.0", - "amqp-1-0", - "amqp10", - "messaging", - "queues" - ], - "repository": { - "type": "git", - "url": "https://github.com/noodlefrenzy/node-amqp10.git" - } -} +{ + "name": "amqp10", + "version": "3.5.4", + "description": "Native AMQP-1.0 client for node.js", + "main": "./lib", + "types": "./typings/lib/index.d.ts", + "engines": { + "node": ">= 0.10" + }, + "dependencies": { + "@types/node": "^9.3.0", + "bl": "^1.1.2", + "bluebird": "^3.4.6", + "buffer-builder": "^0.2.0", + "debug": "^2.3.3", + "lodash": "^4.17.2", + "node-int64": "^0.4.0", + "stately.js": "^1.3.0" + }, + "devDependencies": { + "benchmark": "^2.1.2", + "chai": "^3.5.0", + "chai-as-promised": "^6.0.0", + "chai-string": "^1.3.0", + "conventional-changelog-cli": "^1.2.0", + "gh-pages": "^0.12.0", + "istanbul": "^0.4.5", + "jsdoc": "^3.4.2", + "jshint": "^2.9.4", + "mocha": "^3.2.0", + "qmf2": "^0.1.5", + "semver": "^5.4.1", + "stream-buffers": "^3.0.1" + }, + "scripts": { + "version": "make changelog && git add CHANGELOG.md && make docs", + "tsc": "tsc -p tsconfig.json" + }, + "author": { + "name": "noodlefrenzy", + "email": "milanz@microsoft.com", + "url": "http://www.mikelanzetta.com" + }, + "contributors": [ + { + "name": "mbroadst", + "email": "mbroadst@gmail.com", + "url": "https://github.com/mbroadst" + } + ], + "homepage": "https://github.com/noodlefrenzy/node-amqp10", + "license": "MIT", + "keywords": [ + "amqp", + "amqp 1.0", + "amqp-1-0", + "amqp10", + "messaging", + "queues" + ], + "repository": { + "type": "git", + "url": "https://github.com/noodlefrenzy/node-amqp10.git" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..a4eb93b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,6 @@ +{ + "exclude": [ + "test", + "node_modules" + ] +} \ No newline at end of file diff --git a/typings/lib/adapters/translate_encoder.d.ts b/typings/lib/adapters/translate_encoder.d.ts new file mode 100644 index 0000000..c453e62 --- /dev/null +++ b/typings/lib/adapters/translate_encoder.d.ts @@ -0,0 +1,8 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +declare function encoder(data: any): any; + +export = encoder; \ No newline at end of file diff --git a/typings/lib/amqp_client.d.ts b/typings/lib/amqp_client.d.ts new file mode 100644 index 0000000..b2466bc --- /dev/null +++ b/typings/lib/amqp_client.d.ts @@ -0,0 +1,134 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { EventEmitter } from "events"; + +import Policy = require("./policies/policy"); +import ReceiverLink = require("./receiver_link"); +import SenderLink = require("./sender_link"); +import _ReceiverStream = require("./streams/receiver_stream"); +import _SenderStream = require("./streams/sender_stream"); + +/** + * AMQPClient is the top-level class for interacting with node-amqp10. Instantiate this class, connect, and then send/receive + * as needed and behind the scenes it will do the appropriate work to setup and teardown connections, sessions, and links and manage flow. + * The code does its best to avoid exposing AMQP-specific types and attempts to convert them where possible, but on the off-chance you + * need to speak AMQP-specific (e.g. to set a filter to a described-type), you can use node-amqp-encoder and the + * translator adapter to convert it to our internal types. See simple_eventhub_test.js for an example. + * + * Configuring AMQPClient is done through a Policy class. By default, DefaultPolicy will be used - it assumes AMQP defaults wherever + * possible, and for values with no spec-defined defaults it tries to assume something reasonable (e.g. timeout, max message size). + * + * To define a new policy, you can merge your values into an existing one by calling AMQPClient.policies.merge(yourPolicy, existingPolicy). + * This does a deep-merge, allowing you to only replace values you need. For instance, if you wanted the default sender settle policy to be auto-settle instead of mixed, + * you could just use + * +
+ var AMQP = require('amqp10');
+ var client = new AMQP.Client(AMQP.Policy.merge({
+   senderLink: {
+     attach: {
+       senderSettleMode: AMQP.Constants.senderSettleMode.settled
+     }
+   }
+ });
+ 
+ * + * Obviously, setting some of these options requires some in-depth knowledge of AMQP, so I've tried to define specific policies where I can. + * For instance, for Azure EventHub connections, you can use the pre-build EventHubPolicy. + * + * Also, within the policy, see the encoder and decoder defined in the send/receive policies. These define what to do with the message + * sent/received, and by default do a simple pass-through, leaving the encoding to/decoding from AMQP-specific types up to the library which + * does a best-effort job. See EventHubPolicy for a more complicated example, turning objects into UTF8-encoded buffers of JSON-strings. + */ +declare class AMQPClient extends EventEmitter { + policy: Policy; + + static ErrorReceived: "client:errorReceived"; + static ConnectionOpened: "connection:opened"; + static ConnectionClosed: "connection:closed"; + + /** + * Creates a new AMQPClient instance using DefaultPolicy. + * @constructor + */ + constructor(); + + /** + * Creates a new AMQPClient instance by overriding DefaultPolicy using given overrides. + * + * @param policyOverrides - Additional overrides for the default policy + * @constructor + */ + constructor(policyOverrides?: Policy.Overrides); + + /** + * Creates a new AMQPClient instance. + * + * @param policy - Policy to use for connection, sessions, links, etc. Defaults to DefaultPolicy. + * @param [policyOverrides] - Additional overrides for the provided policy + * @constructor + */ + constructor(policy: Policy, policyOverrides?: Policy.Overrides); + + /** + * Connects to a given AMQP server endpoint. Sets the default queue, so e.g. + * amqp://my-activemq-host/my-queue-name would set the default queue to + * my-queue-name for future send/receive calls. + * + * @param url - URI to connect to, right now only supports `amqp` and `amqps` as protocol. + */ + connect(url: string): Promise; + + /** + * Creates a sender link for the given address, with optional link policy. + * + * @param address An address to connect this link to. If not provided will use default queue from connection uri. + * @param [policyOverrides] Policy overrides used for creating this sender link + * @param [policyOverrides.name] Explicitly set a name for this link, this is an alias to [policyOverrides.attach.name] + */ + createSender(address: string, policyOverrides?: Policy.SenderLink): Promise; + + /** + * Creates a sender link wrapped as a Writable stream. + * + * @param {String} address Address used for link creation + * @param {Object} [policyOverrides] Policy overrides used for creating this sender link + */ + createSenderStream(address: string, policyOverrides?: Policy.SenderLink): Promise<_SenderStream>; + + + /** + * Creates a receiver link for the given address, with optional link policy. The + * promise returned resolves to a link that is an EventEmitter, which can be + * used to listen for 'message' events. + * + * @param {String} address An address to connect this link to. If not provided will use default queue from connection uri. + * @param {Object} [policyOverrides] Policy overrides used for creating this receiver link + * @param {String} [policyOverrides.name] Explicitly set a name for this link, this is an alias to [policyOverrides.attach.name] + */ + createReceiver(address: string, policyOverrides?: Policy.ReceiverLink): Promise; + + /** + * Creates a receiver link wrapped as a Readable stream + * + * @param {String} address Address used for link creation + * @param {Object} [policyOverrides] Policy overrides used for creating the receiver link + */ + createReceiverStream(address: string, policyOverrides?: Policy.ReceiverLink): Promise<_ReceiverStream>; + + /** + * Disconnect tears down any existing connection with appropriate Close + * performatives and TCP socket teardowns. + */ + disconnect(): Promise; +} + +declare namespace AMQPClient { + export type ReceiverStream = _ReceiverStream; + export type SenderStream = _SenderStream; +} + +export = AMQPClient; \ No newline at end of file diff --git a/typings/lib/connection.d.ts b/typings/lib/connection.d.ts new file mode 100644 index 0000000..24b8aef --- /dev/null +++ b/typings/lib/connection.d.ts @@ -0,0 +1,167 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { EventEmitter } from "events"; + +import Policy = require("./policies/policy"); +import Session = require("./session"); + +/** + * Connection states, from AMQP 1.0 spec: + * +
+
START
+

In this state a Connection exists, but nothing has been sent or received. This is the + state an implementation would be in immediately after performing a socket connect or + socket accept.

+
HDR-RCVD
+

In this state the Connection header has been received from our peer, but we have not + yet sent anything.

+
HDR-SENT
+

In this state the Connection header has been sent to our peer, but we have not yet + received anything.

+
OPEN-PIPE
+

In this state we have sent both the Connection header and the open frame, but we have not yet received anything. +

+
OC-PIPE
+

In this state we have sent the Connection header, the open + frame, any pipelined Connection traffic, and the close frame, + but we have not yet received anything.

+
OPEN-RCVD
+

In this state we have sent and received the Connection header, and received an + open frame from our peer, but have not yet sent an + open frame.

+
OPEN-SENT
+

In this state we have sent and received the Connection header, and sent an + open frame to our peer, but have not yet received an + open frame to our peer, but have not yet received an + open frame.

+
CLOSE-PIPE
+

In this state we have send and received the Connection header, sent an + open frame, any pipelined Connection traffic, and the + close frame, but we have not yet received an + open frame.

+
OPENED
+

In this state the Connection header and the open frame + have both been sent and received.

+
CLOSE-RCVD
+

In this state we have received a close frame indicating + that our partner has initiated a close. This means we will never have to read anything + more from this Connection, however we can continue to write frames onto the Connection. + If desired, an implementation could do a TCP half-close at this point to shutdown the + read side of the Connection.

+
CLOSE-SENT
+

In this state we have sent a close frame to our partner. + It is illegal to write anything more onto the Connection, however there may still be + incoming frames. If desired, an implementation could do a TCP half-close at this point + to shutdown the write side of the Connection.

+
DISCARDING
+

The DISCARDING state is a variant of the CLOSE_SENT state where the + close is triggered by an error. In this case any incoming frames on + the connection MUST be silently discarded until the peer's close frame + is received.

+
END
+

In this state it is illegal for either endpoint to write anything more onto the + Connection. The Connection may be safely closed and discarded.

+
+ * + * Connection negotiation state diagram from AMQP 1.0 spec: + * +
+              R:HDR +=======+ S:HDR             R:HDR[!=S:HDR]
+           +--------| START |-----+    +--------------------------------+
+           |        +=======+     |    |                                |
+          \\|/                    \\|/   |                                |
+      +==========+             +==========+ S:OPEN                      |
+ +----| HDR-RCVD |             | HDR-SENT |------+                      |
+ |    +==========+             +==========+      |      R:HDR[!=S:HDR]  |
+ |   S:HDR |                      | R:HDR        |    +-----------------+
+ |         +--------+      +------+              |    |                 |
+ |                 \\|/    \\|/                   \\|/   |                 |
+ |                +==========+               +-----------+ S:CLOSE      |
+ |                | HDR-EXCH |               | OPEN-PIPE |----+         |
+ |                +==========+               +-----------+    |         |
+ |           R:OPEN |      | S:OPEN              | R:HDR      |         |
+ |         +--------+      +------+      +-------+            |         |
+ |        \\|/                    \\|/    \\|/                  \\|/        |
+ |   +===========+             +===========+ S:CLOSE       +---------+  |
+ |   | OPEN-RCVD |             | OPEN-SENT |-----+         | OC-PIPE |--+
+ |   +===========+             +===========+     |         +---------+  |
+ |  S:OPEN |                      | R:OPEN      \\|/           | R:HDR   |
+ |         |       +========+     |          +------------+   |         |
+ |         +----- >| OPENED |< ---+          | CLOSE-PIPE |< -+         |
+ |                 +========+                +------------+             |
+ |           R:CLOSE |    | S:CLOSE              | R:OPEN               |
+ |         +---------+    +-------+              |                      |
+ |        \\|/                    \\|/             |                      |
+ |   +============+          +=============+     |                      |
+ |   | CLOSE-RCVD |          | CLOSE-SENT* |< ---+                      |
+ |   +============+          +=============+                            |
+ | S:CLOSE |                      | R:CLOSE                             |
+ |         |         +=====+      |                                     |
+ |         +------- >| END |< ----+                                     |
+ |                   +=====+                                            |
+ |                     /|\                                              |
+ |    S:HDR[!=R:HDR]    |                R:HDR[!=S:HDR]                 |
+ +----------------------+-----------------------------------------------+
+ 
+ * + * R:CTRL = Received CTRL + * + * S:CTRL = Sent CTRL + * + * Also could be DISCARDING if an error condition triggered the CLOSE + */ +declare class Connection extends EventEmitter { + policy: Policy.Connect; + connected: boolean; + connectedTo: any; + + local: any; + remote: any; + + connSM: any; + + static Connected: "connection:connected"; + static Disconnected: "connection:disconnected"; + /** + * On receipt of a frame not handled internally (e.g. not a BEGIN/CLOSE/SASL). + * Provides received frame as an argument. + */ + static FrameReceived: "connection:frameReceived"; + /** + * Since 'error' events are "special" in Node (as in halt-the-process special), + * using a custom event for errors we receive from the other endpoint. Provides + * received AMQPError as an argument. + */ + static ErrorReceived: "connection:errorReceived"; + + /** + * Creates a new Connection instance. + * + * @param connectPolicy ConnectPolicy from a Policy instance + * @constructor + */ + constructor(connectPolicy: Policy.Connect); + + /** + * Open a connection to the given (parsed) address (@see {@link AMQPClient}). + * + * @param address Contains at least protocol, host and port, may contain user/pass, path. + * @param sasl If given, contains a "negotiate" method that, given address and a callback, will run through SASL negotiations. + */ + open(address: Policy.Address, sasl?: { negotiate(address: Policy.Address, callback: Function): void; }): void; + + close(): void; + + sendFrame(frame: any): void; + + associateSession(session: Session): number; + dissociateSession(channel: number): void; + + sendHeader(header: Buffer): void; +} + +export = Connection; diff --git a/typings/lib/constants.d.ts b/typings/lib/constants.d.ts new file mode 100644 index 0000000..5b24ac5 --- /dev/null +++ b/typings/lib/constants.d.ts @@ -0,0 +1,80 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +export const defaultPort: number; +export const defaultTlsPort: number; + +export const minMaxFrameSize: number; +export const defaultMaxFrameSize: number; +export const defaultChannelMax: number; +export const defaultIdleTimeout: number; + +export const requiredLocale: string; +export const defaultOutgoingLocales: string; +export const defaultIncomingLocales: string; + +export const defaultHandleMax: number; + +export const amqpVersion: Buffer; +export const saslVersion: Buffer; + +export const session: { + defaultIncomingWindow: number; + defaultOutgoingWindow: number; + defaultOutgoingId: number; +}; + +export const frameType: { + amqp: number; + sasl: number; +}; + +export const saslOutcomes: { + ok: number; + auth: number; + sys: number; + sys_perm: number; + sys_temp: number; + + 0: string; + 1: string; + 2: string; + 3: string; + 4: string; +}; + +export const linkRole: { + sender: boolean; + receiver: boolean; +}; + +export const senderSettleMode: { + unsettled: number; + settled: number; + mixed: number; +}; + +export const receiverSettleMode: { + autoSettle: number; + settleOnDisposition: number; +}; + +export const terminusDurability: { + none: number; + configuration: number; + unsettledState: number; +}; + +export const terminusExpiryPolicy: { + linkDetach: "link-detach"; + sessionEnd: "session-end"; + connectionClose: "connection-close"; + never: "never"; +}; + +export const distributionMode: { + move: "move"; + copy: "copy"; +}; \ No newline at end of file diff --git a/typings/lib/errors.d.ts b/typings/lib/errors.d.ts new file mode 100644 index 0000000..ec3ef57 --- /dev/null +++ b/typings/lib/errors.d.ts @@ -0,0 +1,122 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +/** The base error all amqp10 Errors inherit from. */ +export class BaseError extends Error { + name: string; + message: string; + stack: string; + + constructor(message: string); +} + +export class ProtocolError extends BaseError { + name: "AmqpProtocolError"; + condition: string; + description: string; + errorInfo: any; + + constructor(condition: string, description?: string, errorInfo?: any); +} + +/** AMQP Header is malformed. */ +export class MalformedHeaderError extends BaseError { + name: "AmqpMalformedHeaderError"; + + constructor(header: string); +} + +/** Method or feature is not yet implemented. */ +export class NotImplementedError extends BaseError { + name: "AmqpNotImplementedError"; + + constructor(feature: string); +} + +/** Payload is malformed or cannot be parsed. */ +export class MalformedPayloadError extends BaseError { + name: "AmqpMalformedPayloadError"; + + constructor(payload: string); +} + +/** Given object cannot be encoded successfully. */ +export class EncodingError extends BaseError { + name: "AmqpEncodingError"; + value: any; + + /** + * @param value - The value that caused the encoding error. + * @param message - An optional message giving context to the error. + */ + constructor(value: any, message?: string); +} + +/** Violation of AMQP flow control. */ +export class OverCapacityError extends BaseError { + name: "AmqpOverCapacityError"; + + constructor(msg: string); +} + +/** Authentication failure. */ +export class AuthenticationError extends BaseError { + name: "AmqpAuthenticationError"; + + constructor(msg: string); +} + +/** Argument missing or incorrectly defined. */ +export class ArgumentError extends BaseError { + name: "AmqpArgumentError"; + + constructor(arg: string |string[]); +} + +/** Invalid state. */ +export class InvalidStateError extends BaseError { + name: "AmqpInvalidStateError"; + + constructor(msg: string); +} + +/** Connection error. */ +export class ConnectionError extends BaseError { + name: "AmqpConnectionError"; + + constructor(msg: string); +} + +/** Disconnected error. */ +export class DisconnectedError extends BaseError { + name: "AmqpDisconnectedError"; + + constructor(msg: string); +} + +/** AMQP Version error. */ +export class VersionError extends BaseError { + name: "AmqpVersionError"; + + constructor(msg: string); +} + +/** + * Invalid subject specified for receiver or sender link creation. + */ +export class InvalidSubjectError extends BaseError { + name: "AmqpInvalidSubjectError"; + + constructor(subject: string); +} + +/** + * Used to signal transport-related errors + */ +export class TransportError extends BaseError { + name: "AmqpTransportError"; + + constructor(msg: string); +} diff --git a/typings/lib/frames.d.ts b/typings/lib/frames.d.ts new file mode 100644 index 0000000..376579c --- /dev/null +++ b/typings/lib/frames.d.ts @@ -0,0 +1,122 @@ +/** + * Types only + */ +export interface Frame { + type: number; +} + +export interface OpenFrame { + containerId: string; + hostname: string; + maxFrameSize: number; + channelMax: number; + idleTimeout: number; + outgoingLocales: string; + incomingLocales: string; + offeredCapabilities: string; + desiredCapabilities: string; + properties: Object; +} + +export interface BeginFrame { + remoteChannel: number; + nextOutgoingId: number; + incomingWindow: number; + outgoingWindow: number; + handleMax: number; + offeredCapabilities: string; + desiredCapabilities: string; + properties: Object; +} + +export interface AttachFrame { + name: string; + handle: string; + role: boolean; + sndSettleMode: string; + rcvSettleMode: string; + source: any; + target: any; + unsettled: { [key: string]: any }; + incompleteUnsettled: boolean; + initialDeliveryCount: number; + maxMessageSize: number; + offeredCapabilities: string; + desiredCapabilities: string; + properties: Object; +} + +export interface FlowFrame { + nextIncomingId: number; + incomingWindow: number; + nextOutgoingId: number; + outgoingWindow: number; + handle: string; + deliveryCount: number; + linkCredit: number; + available: number; + drain: boolean; + echo: boolean; + properties: Object; +} + +export interface TransferFrame { + handle: string; + deliveryId: number; + deliveryTag: number; + messageFormat: number; + settled: boolean; + more: boolean; + rcvSettleMode: number; + state: any; + resume: boolean; + aborted: boolean; + batchable: boolean; +} + +export interface DispositionFrame { + role: boolean; + first: number; + last: number; + settled: number; + state: any; + batchable: boolean; +} + +export interface DetachFrame { + handle: string; + closed: boolean; + error: any; +} + +export interface EndFrame { + error: any; +} + +export interface CloseFrame { + error: any; +} + +// SASL frames +export interface SaslMechanismsFrame { + saslServerMechanisms: string; +} + +export interface SaslInitFrame { + mechanism: string; + initialResponse: Buffer; // Is this right? + hostname: string; +} + +export interface SaslChallengeFrame { + challenge: Buffer; // Is this right? +} + +export interface SaslResponseFrame { + response: Buffer; // Is this right? +} + +export interface SaslOutcomeFrame { + code: number; + additionalData: Buffer; +} diff --git a/typings/lib/index.d.ts b/typings/lib/index.d.ts new file mode 100644 index 0000000..3d2a4cf --- /dev/null +++ b/typings/lib/index.d.ts @@ -0,0 +1,91 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import _Policy = require("./policies/policy"); +import _EventHub = require("./policies/event_hub_policy"); +import _ServiceBusQueue = require("./policies/service_bus_queue_policy"); +import _ServiceBusTopic = require("./policies/service_bus_topic_policy"); +import _QpidJava = require("./policies/qpid_java_policy"); +import _ActiveMQ = require("./policies/activemq_policy"); +import _Utils = require('./policies/policy_utilities'); + +export import Client = require("./amqp_client"); +export import Constants = require("./constants"); +export import Errors = require("./errors"); + +/** + * Policies encode many of the optional behaviors and settings of AMQP into a + * cohesive place that could potentially be standardized, could be loaded from + * JSON, etc. + */ +export namespace Policy { + export import PolicyBase = _Policy; + export const Default: _Policy; + + export const EventHub: typeof _EventHub; + export const ServiceBusQueue: typeof _ServiceBusQueue; + export const ServiceBusTopic: typeof _ServiceBusTopic; + export const QpidJava: typeof _QpidJava; + export const ActiveMQ: typeof _ActiveMQ; + + export import Utils = _Utils; + + /** + * Create a new Policy by extending the Base Policy. + * + * @param overrides - Configuration overrides. + * @returns Extended configuration. + */ + export function merge(overrides: Options.Overrides): PolicyBase + /** + * Create a new Policy by extending given base policy using given overrides configuration. + * + * @param overrides - Configuration overrides. + * @param base - Base configuration to extend. + * @returns Extended configuration. + */ + export function merge(overrides: Options.Overrides, base: PolicyBase): PolicyBase; + + /** Typings only */ + export namespace Options { + export type Overrides = _Policy.Overrides; + export type Reconnect = _Policy.Reconnect; + export type Connect = _Policy.Connect; + export type ConnectOptions = _Policy.ConnectOptions; + export type SSLOptions = _Policy.SSLOptions; + export type Session = _Policy.Session; + export type SessionOptions = _Policy.SessionOptions; + export type SenderLink = _Policy.SenderLink; + export type SenderLinkAttach = _Policy.SenderLinkAttach; + export type ReceiverLink = _Policy.ReceiverLink; + export type ReceiverLinkAttach = _Policy.ReceiverLinkAttach; + export type Address = _Policy.Address; + } +} + +export import TransportProvider = require("./transport/index"); +export import DescribedType = require("./types/described_type"); + +/** + * translator, which allows you to translate from node-amqp-encoder'd + * values into the internal types used in this library. (e.g. + * [ 'symbol', 'symval' ] => Symbol('symval') ). + */ +export import translator = require("./adapters/translate_encoder"); + +/** + * Syntactic sugar for pluggable amqp10 Client behaviors. + */ +export function use(plugin: (client: typeof Client) => void): void; + +// Typings only +import _ReceiverLink = require("./receiver_link"); +export type ReceiverLink = _ReceiverLink; +export type Message = _ReceiverLink.Message; +export type ModifyOptions = _ReceiverLink.ModifyOptions; + +import _SenderLink = require("./sender_link"); +export type SenderLink = _SenderLink; +export type MessageOptions = _SenderLink.MessageOptions; diff --git a/typings/lib/link.d.ts b/typings/lib/link.d.ts new file mode 100644 index 0000000..8a61ec1 --- /dev/null +++ b/typings/lib/link.d.ts @@ -0,0 +1,83 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { EventEmitter } from "events"; +import Session = require("./session"); +import Policy = require("./policies/policy"); + +type LinkPolicy = Policy.SenderLink | Policy.ReceiverLink; + +declare class Link extends EventEmitter { + policy: LinkPolicy; + session: Session; + handle: string; + remote: Link.Remote; + deliveryCount: number; + linkSM: any; + + name: string; + role: boolean; + linkCredit: number; + totalCredits: number; + available: number; + drain: boolean; + + /** On receipt of a message. Message payload given as argument. */ + static MessageReceived: "message"; + + /** Since "error" events are "special" in Node (as in halt-the-process special), + * using a custom event for errors we receive from the other endpoint. Provides + * received AMQPError as an argument. + */ + static ErrorReceived: "errorReceived"; + + /** On link credit changed. */ + static CreditChange: "creditChange"; + + /** On completion of detach. */ + static Attached: "attached"; + + /** On completion of detach. */ + static Detached: "detached"; + + constructor(session: Session, handle: string, linkPolicy: LinkPolicy); + + state(): string; + attach(): void; + detach(options?: Link.DetachOptions): Promise; + forceDetach(): void; + flow(flowOptions?: Link.FlowOptions): void; + shouldReatttach(): boolean; +} + +declare namespace Link { + export interface Remote { + handle: string; + attach: any; + detach: any; + } + + export interface FlowOptions { + channel?: string; + handle?: string; + linkCredit?: number; + nextIncomingId?: string; + incomingWindow?: number; + nextOutgoingId?: string; + outgoingWindow?: number; + available?: boolean; + deliveryCount?: number; + drain?: boolean; + } + + export interface DetachOptions { + handle?: string; + channel?: string; + closed?: boolean; + error?: any; + } +} + +export = Link; diff --git a/typings/lib/policies/activemq_policy.d.ts b/typings/lib/policies/activemq_policy.d.ts new file mode 100644 index 0000000..9d9d937 --- /dev/null +++ b/typings/lib/policies/activemq_policy.d.ts @@ -0,0 +1,8 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import Policy = require("./policy"); +declare const policy: Policy; +export = policy; diff --git a/typings/lib/policies/event_hub_policy.d.ts b/typings/lib/policies/event_hub_policy.d.ts new file mode 100644 index 0000000..ee98919 --- /dev/null +++ b/typings/lib/policies/event_hub_policy.d.ts @@ -0,0 +1,8 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import ServiceBusPolicy = require("./service_bus_policy"); + +export = ServiceBusPolicy; diff --git a/typings/lib/policies/policy.d.ts b/typings/lib/policies/policy.d.ts new file mode 100644 index 0000000..762355d --- /dev/null +++ b/typings/lib/policies/policy.d.ts @@ -0,0 +1,151 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { WindowPolicy, CreditPolicy } from "./policy_utilities"; + +/** + * The default policy for amqp10 clients. + */ +declare class Policy implements Policy.Overrides { + defaultSubjects: boolean; + reconnect: Policy.Reconnect; + connect: Policy.Connect; + session: Policy.Session; + senderLink: Policy.SenderLink; + receiverLink: Policy.ReceiverLink; + + /** + * Creates a new default Policy. + * @param overrides - override values for the default policy + */ + constructor(overrides?: Policy.Overrides); + + /** + * Parses an address for use when connecting to an AMQP 1.0 broker + * + * @param address - the address to parse + * @returns Parsed URL. + */ + parseAddress(address: string): Policy.Address; +} + +declare namespace Policy { + /** Policy Configuration. */ + export interface Overrides { + /** + * support subjects in link names with the following characteristics: + * receiver: "amq.topic/news", means a filter on the ReceiverLink will be made + * for messages send with a subject "news" + * + * sender: "amq.topic/news", will automatically set "news" as the subject for + * messages sent on this link, unless the user explicitly overrides + * the subject. + */ + defaultSubjects?: boolean; + + reconnect?: Reconnect; + + connect?: Connect; + + session?: Session; + + senderLink?: SenderLink; + + receiverLink?: ReceiverLink; + } + + export interface Reconnect { + retries?: number; + strategy?: "fibonacci" | "exponential"; + forever?: boolean; + } + + export interface Connect { + options?: ConnectOptions; + } + + export interface ConnectOptions { + containerId?: string; + hostname?: string; + maxFrameSize?: number; + channelMax?: number; + idleTimeout?: number; + outgoingLocales?: string; + incomingLocales?: string; + offeredCapabilities?: any; + desiredCapabilities?: any; + properties?: any; + sslOptions?: SSLOptions; + } + + export interface SSLOptions { + keyFile?: string; + certFile?: string; + caFile?: string; + rejectUnauthorized?: boolean; + } + + export interface Session { + options?: SessionOptions; + window?: WindowPolicy; + windowQuantum?: number; + enableSessionFlowControl?: boolean; + } + + export interface SessionOptions { + nextOutgoingId?: number; + incomingWindow?: number; + outgoingWindow?: number; + } + + export interface SenderLink { + /** Only for createReceiver: alias to [link.attach.name] */ + name?: string; + attach?: SenderLinkAttach; + callback?: "settled" | "sent"; + encoder?: any; + reattach?: any; + } + + export interface SenderLinkAttach { + name?: string; + role?: boolean; + senderSettleMode?: number; + maxMessageSize?: number; + initialDeliveryCount?: number; + } + + export interface ReceiverLink { + /** Only for createReceiver: alias to [link.attach.name] */ + name?: string; + attach?: ReceiverLinkAttach; + credit?: CreditPolicy; + creditQuantum?: number; + decoder?: any; + reattach?: any; + } + + export interface ReceiverLinkAttach { + name?: string; + role?: boolean; + receiverSettleMode?: number; + maxMessageSize?: number; + initialDeliveryCount?: number; + } + + export interface Address { + host: string; + path: string; + protocol: string; + href: string; + port: number; + rootUri: string; + + user?: string; + pass?: string; + } +} + +export = Policy; \ No newline at end of file diff --git a/typings/lib/policies/policy_utilities.d.ts b/typings/lib/policies/policy_utilities.d.ts new file mode 100644 index 0000000..4bb778e --- /dev/null +++ b/typings/lib/policies/policy_utilities.d.ts @@ -0,0 +1,38 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import * as Policy from "./policy"; +import Session = require("../session"); +import Link = require("../link"); + +export type WindowPolicy = (session: Session) => void; + +export const WindowPolicies: { + RefreshAtHalf: WindowPolicy; + RefreshAtEmpty: WindowPolicy; + DoNotRefresh: WindowPolicy; +}; + +export type CreditPolicy = (link: Link, options?: any) => void; + +export const CreditPolicies: { + RefreshAtHalf: CreditPolicy; + RefreshAtEmpty: CreditPolicy; + RefreshSettled(treshold: number): CreditPolicy; + DoNotRefresh: CreditPolicy; +}; + +export const SenderCallbackPolicies: { + /** Only callback when settled Disposition received from recipient. */ + OnSettle: 'settled'; + + /** Callback as soon as sent, will not call-back again if future disposition results in error. */ + OnSent: 'sent'; +}; + +export function Merge(newPolicy: Policy.Overrides, base: Policy.Overrides): typeof newPolicy & typeof base; + +/** Receiver links process messages N at a time, only renewing credits on ack. */ +export function RenewOnSettle(initialCredit: number, treshold: number, basePolicy?: Policy.Overrides): Policy; \ No newline at end of file diff --git a/typings/lib/policies/qpid_java_policy.d.ts b/typings/lib/policies/qpid_java_policy.d.ts new file mode 100644 index 0000000..ee77258 --- /dev/null +++ b/typings/lib/policies/qpid_java_policy.d.ts @@ -0,0 +1,10 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import Policy = require("./policy"); + +declare const policy: Policy; +export = policy; + diff --git a/typings/lib/policies/service_bus_policy.d.ts b/typings/lib/policies/service_bus_policy.d.ts new file mode 100644 index 0000000..7e18ffc --- /dev/null +++ b/typings/lib/policies/service_bus_policy.d.ts @@ -0,0 +1,9 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import Policy = require("./policy"); + +declare const policy: Policy; +export = policy; diff --git a/typings/lib/policies/service_bus_queue_policy.d.ts b/typings/lib/policies/service_bus_queue_policy.d.ts new file mode 100644 index 0000000..ee98919 --- /dev/null +++ b/typings/lib/policies/service_bus_queue_policy.d.ts @@ -0,0 +1,8 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import ServiceBusPolicy = require("./service_bus_policy"); + +export = ServiceBusPolicy; diff --git a/typings/lib/policies/service_bus_topic_policy.d.ts b/typings/lib/policies/service_bus_topic_policy.d.ts new file mode 100644 index 0000000..ee98919 --- /dev/null +++ b/typings/lib/policies/service_bus_topic_policy.d.ts @@ -0,0 +1,8 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import ServiceBusPolicy = require("./service_bus_policy"); + +export = ServiceBusPolicy; diff --git a/typings/lib/receiver_link.d.ts b/typings/lib/receiver_link.d.ts new file mode 100644 index 0000000..289f8b3 --- /dev/null +++ b/typings/lib/receiver_link.d.ts @@ -0,0 +1,104 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import Link = require("./link"); +import Session = require("./session"); +import Policy = require("./policies/policy"); +import { DeliveryState } from "./types/delivery_state"; +import { BaseError } from "./errors"; +import { TransferFrame } from "./frames"; + +type Message = ReceiverLink.Message; + +declare class ReceiverLink extends Link { + policy: Policy.ReceiverLink; + settledMessagesSinceLastCredit: number; + linkCredits: number; + totalCredits: number; + + constructor(session: Session, handle: string, linkPolicy: Policy.ReceiverLink); + + addCredits(credits: number, flowOptions?: Link.FlowOptions): void; + + /** + * Settle a message (or array of messages) with an Accepted delivery outcome + * + * @param {String|Array} [message] message, or array of messages to settle + */ + accept(message?: Message | Message[]): void; + + /** + * Settle a message (or array of messages) with a Rejected delivery outcome + * + * @param {String|Array} [message] message, or array of messages to settle + * @param {String} [error] error that caused the message to be rejected + */ + reject(message?: Message | Message[], error?: string): void; + + /** + * Settle a message (or array of messages) with a Released delivery outcome + * + * @param {String|Array} [message] message, or array of messages to settle + */ + release(message?: Message | Message[]): void; + + /** + * Settle a message (or array of messages) with a Modified delivery outcome + * + * @param {String|Array} [message] message, or array of messages to settle + * @param {Object} [options] options used for a Modified outcome + */ + modify(message?: Message | Message[], options?: ReceiverLink.ModifyOptions): void; + + /** + * Settle a message (or array of messages) with a given delivery state + * + * @param {String|Array} [message] message, or array of messages to settle + * @param {Object} [state] outcome of message delivery + */ + settle(message?: Message | Message[], state?: DeliveryState): void; + + /** Message event handler */ + on(event: "message", listener: (msg: Message, frame: TransferFrame) => void): this; + /** Error event handler */ + on(event: "errorReceived", listener: (err: BaseError) => void): this; + on(event: "creditChange" | "attached" | "detached", listener: Function): this; + on(event: string, listener: Function): this; +} + +declare namespace ReceiverLink { + export interface Dictionary { + [key: string]: T; + } + + export interface ModifyOptions { + /** count the transfer as an unsuccessful delivery attempt. */ + deliveryFailed?: boolean; + + /** prevent redelivery. */ + undeliverableHere?: boolean; + + /** message attributes to combine with existing annotations. */ + messageAnnotations?: Object; + } + + export interface Message extends Dictionary { + body?: any; + + properties?: Dictionary; + + /** + * Annotations for the message, if any. See AMQP spec for details, and server for specific + * annotations that might be relevant (e.g. x-opt-partition-key on EventHub). If node-amqp-encoder'd + * map is given, it will be translated to appropriate internal types. Simple maps will be converted + * to AMQP Fields type as defined in the spec. + */ + annotations?: Dictionary; + + applicationProperties?: Dictionary; + } +} + +export = ReceiverLink; diff --git a/typings/lib/sender_link.d.ts b/typings/lib/sender_link.d.ts new file mode 100644 index 0000000..7821682 --- /dev/null +++ b/typings/lib/sender_link.d.ts @@ -0,0 +1,61 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import Link = require("./link"); +import Session = require("./session"); +import Policy = require("./policies/policy"); +import { DeliveryState } from "./types/delivery_state"; +import { BaseError } from "./errors"; + +declare class SenderLink extends Link { + policy: Policy.SenderLink; + initialDeliveryCount: number; + + constructor(session: Session, handle: string, linkPolicy: Policy.SenderLink); + + canSend(): boolean; + + /** + * Sends the given message, with the given options on this link + * + * @param {*} msg Message to send. Will be encoded using sender link policy's encoder. + * @param {*} [options] An object of options to attach to the message including: annotations, properties, + and application properties + * @param options.annotations Annotations for the message, if any. See AMQP spec for details, and server for specific + * annotations that might be relevant (e.g. x-opt-partition-key on EventHub). If node-amqp-encoder'd + * map is given, it will be translated to appropriate internal types. Simple maps will be converted + * to AMQP Fields type as defined in the spec. + */ + send(message: any, options?: SenderLink.MessageOptions | Object): Promise; + + /** Error event handler */ + on(event: "errorReceived", listener: (err: BaseError) => void): this; + on(event: "creditChange" | "attached" | "detached", listener: Function): this; + on(event: string, listener: Function): this; +} + +declare namespace SenderLink { + export interface Dictionary { + [key: string]: T; + } + + export interface MessageOptions extends Dictionary { + body: any; + + properties?: Dictionary; + + /** + * Annotations for the message, if any. See AMQP spec for details, and server for specific + * annotations that might be relevant (e.g. x-opt-partition-key on EventHub). If node-amqp-encoder'd + * map is given, it will be translated to appropriate internal types. Simple maps will be converted + * to AMQP Fields type as defined in the spec. + */ + annotations?: Dictionary; + + applicationProperties?: Dictionary; + } +} + +export = SenderLink; diff --git a/typings/lib/session.d.ts b/typings/lib/session.d.ts new file mode 100644 index 0000000..443f564 --- /dev/null +++ b/typings/lib/session.d.ts @@ -0,0 +1,121 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { EventEmitter } from "events"; + +import Policy = require("./policies/policy"); +import Connection = require("./connection"); +import ReceiverLink = require("./receiver_link"); +import SenderLink = require("./sender_link"); +import Link = require("./link"); + +/** + * A Session is a bidirectional sequential conversation between two containers that provides a + * grouping for related links. Sessions serve as the context for link communication. Any number + * of links of any directionality can be attached to a given Session. However, a link + * may be attached to at most one Session at a time. + * + * Session states, from AMQP 1.0 spec: + * +
+
UNMAPPED
+

In the UNMAPPED state, the Session endpoint is not mapped to any incoming or outgoing + channels on the Connection endpoint. In this state an endpoint cannot send or receive + frames.

+
BEGIN-SENT
+

In the BEGIN-SENT state, the Session endpoint is assigned an outgoing channel number, + but there is no entry in the incoming channel map. In this state the endpoint may send + frames but cannot receive them.

+
BEGIN-RCVD
+

In the BEGIN-RCVD state, the Session endpoint has an entry in the incoming channel + map, but has not yet been assigned an outgoing channel number. The endpoint may receive + frames, but cannot send them.

+
MAPPED
+

In the MAPPED state, the Session endpoint has both an outgoing channel number and an + entry in the incoming channel map. The endpoint may both send and receive + frames.

+
END-SENT
+

In the END-SENT state, the Session endpoint has an entry in the incoming channel map, + but is no longer assigned an outgoing channel number. The endpoint may receive frames, + but cannot send them.

+
END-RCVD
+

In the END-RCVD state, the Session endpoint is assigned an outgoing channel number, + but there is no entry in the incoming channel map. The endpoint may send frames, but + cannot receive them.

+
DISCARDING
+

The DISCARDING state is a variant of the END-SENT state where the end + is triggered by an error. In this case any incoming frames on the session MUST be + silently discarded until the peer's end frame is received.

+
+
+                         UNMAPPED< ------------------+
+                            |                        |
+                    +-------+-------+                |
+            S:BEGIN |               | R:BEGIN        |
+                    |               |                |
+                   \\|/             \\|/               |
+                BEGIN-SENT      BEGIN-RCVD           |
+                    |               |                |
+                    |               |                |
+            R:BEGIN |               | S:BEGIN        |
+                    +-------+-------+                |
+                            |                        |
+                           \\|/                       |
+                          MAPPED                     |
+                            |                        |
+              +-------------+-------------+          |
+ S:END(error) |       S:END |             | R:END    |
+              |             |             |          |
+             \\|/           \\|/           \\|/         |
+          DISCARDING     END-SENT      END-RCVD      |
+              |             |             |          |
+              |             |             |          |
+        R:END |       R:END |             | S:END    |
+              +-------------+-------------+          |
+                            |                        |
+                            |                        |
+                            +------------------------+
+  
+ * + * There is no obligation to retain a Session Endpoint when it is in the UNMAPPED state, i.e. + * the UNMAPPED state is equivalent to a NONEXISTENT state. + * + * Note: This implementation *assumes* it is the client, and thus will always be the one BEGIN-ing a Session. + * + * @param {Connection} conn Connection to bind session to. + * @constructor + */ +declare class Session extends EventEmitter { + connection: Connection; + mapped: boolean; + remoteChannel: any; + sessionSM: any; + + static Mapped: "mapped"; + static Unmapped: "unmapped"; + static ErrorReceived: "errorReceived"; + static DispositionReceived: "disposition"; + + /** + * Create a new Session instance. + * + * @param {Connection} conn - Connection to bind session to. + * @constructor + */ + constructor(conn: Connection); + + begin(sessionPolicy: Policy.Session): void; + + createLink(linkPolicy: Policy.ReceiverLink): ReceiverLink; + createLink(linkPolicy: Policy.SenderLink): SenderLink; + + addWindow(windowSize: number, flowOptions?: Link.FlowOptions): void; + + detachLink(link: Link): Promise; + + end(): void; +} + +export = Session; diff --git a/typings/lib/streams/receiver_stream.d.ts b/typings/lib/streams/receiver_stream.d.ts new file mode 100644 index 0000000..40557b5 --- /dev/null +++ b/typings/lib/streams/receiver_stream.d.ts @@ -0,0 +1,10 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { Readable } from "stream"; + +declare class ReceiverStream extends Readable { } + +export = ReceiverStream; diff --git a/typings/lib/streams/sender_stream.d.ts b/typings/lib/streams/sender_stream.d.ts new file mode 100644 index 0000000..fb00912 --- /dev/null +++ b/typings/lib/streams/sender_stream.d.ts @@ -0,0 +1,10 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { Writable } from "stream"; + +declare class SenderStream extends Writable { } + +export = SenderStream; diff --git a/typings/lib/transport/abstract_transport.d.ts b/typings/lib/transport/abstract_transport.d.ts new file mode 100644 index 0000000..731c0f2 --- /dev/null +++ b/typings/lib/transport/abstract_transport.d.ts @@ -0,0 +1,18 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { EventEmitter } from "events"; +import { Address } from "../policies/policy"; +import { TransportFactory, TransportProvider } from "./index"; + +declare abstract class AbstractTransport extends EventEmitter implements TransportFactory { + static register(provider: TransportProvider): void; + abstract connect(address: Address): void; + abstract write(data: string | Buffer): void; + abstract end(): void; + abstract destroy(): void; +} + +export = AbstractTransport; diff --git a/typings/lib/transport/index.d.ts b/typings/lib/transport/index.d.ts new file mode 100644 index 0000000..730fe38 --- /dev/null +++ b/typings/lib/transport/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import { EventEmitter } from "events"; +import { Address } from "../policies/policy"; + +// declare class TransportProvider implements provider.TransportProvider { +// registerTransport(protocol: string, transportFactory: provider.TransportFactory): void; +// getTransportFor(protocol: string): provider.TransportFactory; +// } + +declare const provider: provider.TransportProvider; + +declare namespace provider { + + export interface TransportProvider { + registerTransport(protocol: string, transportFactory: TransportFactory): void; + getTransportFor(protocol: string): TransportFactory; + } + + export interface TransportFactory extends EventEmitter { + connect(address: Address): void; + write(data: string | Buffer): void; + end(): void; + destroy(): void; + } +} + +export = provider; \ No newline at end of file diff --git a/typings/lib/transport/net_transport.d.ts b/typings/lib/transport/net_transport.d.ts new file mode 100644 index 0000000..b6e72f1 --- /dev/null +++ b/typings/lib/transport/net_transport.d.ts @@ -0,0 +1,18 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import AbstractTransport = require("./abstract_transport"); +import { Address } from "../policies/policy"; +import { TransportProvider } from "./index"; + +declare class NetTransport extends AbstractTransport { + static register(provider: TransportProvider): void; + connect(address: Address): void; + write(data: string | Buffer): void; + end(): void; + destroy(): void; +} + +export = NetTransport; diff --git a/typings/lib/transport/tls_transport.d.ts b/typings/lib/transport/tls_transport.d.ts new file mode 100644 index 0000000..5db21b0 --- /dev/null +++ b/typings/lib/transport/tls_transport.d.ts @@ -0,0 +1,18 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import AbstractTransport = require("./abstract_transport"); +import { Address } from "../policies/policy"; +import { TransportProvider } from "./index"; + +declare class TlsTransport extends AbstractTransport { + static register(provider: TransportProvider): void; + connect(address: Address): void; + write(data: string | Buffer): void; + end(): void; + destroy(): void; +} + +export = TlsTransport; diff --git a/typings/lib/types/composite_type.d.ts b/typings/lib/types/composite_type.d.ts new file mode 100644 index 0000000..10184a6 --- /dev/null +++ b/typings/lib/types/composite_type.d.ts @@ -0,0 +1,55 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import DescribedType = require("./described_type"); +import ForcedType = require("./forced_type"); + +export abstract class Composite { + value: any[]; + + static fields: Field[]; + static descriptor: CompositeDescriptor; + + constructor(fields?: Object); + + toDescribedType(): DescribedType; + inspect(depth?: number): string; +} + +export interface CompositeConstructor { + new (): Composite; + prototype: Composite; + + fields: Field[]; + descriptor: CompositeDescriptor; +} + +export interface CompositeDescriptor { + code: number; + name: string; +} + +export interface Field { + name: string; + type: string; + mandatory?: boolean; + default?: T; + requires?: Constructor | (() => any); + multiple?: boolean; +} + +export type Constructor = { new (): any; }; + +export interface CompositeDefinition { + name: string; + code: number; + fields: Field[]; +} + +export function defineComposite(definition: CompositeDefinition): CompositeConstructor; +export function defineComposite(Base: Constructor, definition: CompositeDefinition): CompositeConstructor; + +export function wrapField(field: Field, value?: Composite): Composite; +export function wrapField(field: Field, value?: T | T[] | ForcedType): T | ForcedType; \ No newline at end of file diff --git a/typings/lib/types/delivery_state.d.ts b/typings/lib/types/delivery_state.d.ts new file mode 100644 index 0000000..0fb8a05 --- /dev/null +++ b/typings/lib/types/delivery_state.d.ts @@ -0,0 +1,50 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +import ForcedType = require("./forced_type"); +import { Composite } from "./composite_type"; + +export type DeliveryState = Received | Accepted | Rejected | Released | Modified; + +export class Received extends Composite implements ReceivedOptions { + sectionNumber: number; + sectionOffset: number; + + constructor(options: ReceivedOptions); +} +export interface ReceivedOptions { + sectionNumber: number; + sectionOffset: number; +} + +export class Accepted extends Composite { + constructor(options: ReceivedOptions); +} + +export class Rejected extends Composite implements RejectedOptions { + error: string; + + constructor(options: RejectedOptions); +} +export interface RejectedOptions { + error?: string; +} + +export class Released extends Composite { + constructor(options: ReceivedOptions); +} + +export class Modified extends Composite implements ModifiedOptions { + deliveryFailed: boolean; + undeliverableHere: boolean; + messageAnnotations: Object; + + constructor(options: ModifiedOptions); +} +export interface ModifiedOptions { + deliveryFailed: boolean; + undeliverableHere: boolean; + messageAnnotations: Object; +} \ No newline at end of file diff --git a/typings/lib/types/described_type.d.ts b/typings/lib/types/described_type.d.ts new file mode 100644 index 0000000..24783a4 --- /dev/null +++ b/typings/lib/types/described_type.d.ts @@ -0,0 +1,51 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +/** + * Described type, as described in the AMQP 1.0 spec as follows: + * + * constructor untyped bytes + * | | + * +-----------+-----------+ +-----------------+-----------------+ + * | | | | + *... 0x00 0xA1 0x03 "URL" 0xA1 0x1E "http://example.org/hello-world" ... + * | | | | | + * +------+------+ | | | + * | | | | + * descriptor | +------------------+----------------+ + * | | + * | string value encoded according + * | to the str8-utf8 encoding + * | + * primitive format code + * for the str8-utf8 encoding + * + * (Note: this example shows a string-typed descriptor, which should be considered reserved) + */ +declare class DescribedType { + descriptor: number; + value: T; + + /** + * @constructor + * @param descriptorOrType Descriptor for the type (can be any valid AMQP type, including another described type), or the type itself. + * @param value Value of the described type (can also be any valid AMQP type, including another described type). + */ + constructor(descriptorOrType: number | DescribedType.DescriptorType, value: T); + + getValue(): T; +} + +declare namespace DescribedType { + export interface DescriptorType { + prototype: { + Descriptor: { + code: number; + }; + }; + } +} + +export = DescribedType; diff --git a/typings/lib/types/forced_type.d.ts b/typings/lib/types/forced_type.d.ts new file mode 100644 index 0000000..9c9d39c --- /dev/null +++ b/typings/lib/types/forced_type.d.ts @@ -0,0 +1,24 @@ +// Type definitions for node-amqp10 v3 +// Project: https://github.com/noodlefrenzy/node-amqp10 +// Definitions by: Maxime LUCE +// Definitions: https://github.com/typed-contrib/node-amqp10 + +/** + * ForcedType coerces the encoder to encode to the given type, regardless of what it might think. + */ +declare class ForcedType { + /** + * Create a new ForcedType instance. + * + * @param typeName Symbolic name or specific code (e.g. 'long', or 0xA0) + * @param value Value to encode, should be compatible or bad things will occur + * @constructor + */ + constructor(typeName: string, value: T); + + inspect(depth?: number): string; + + valueOf(): T; +} + +export = ForcedType; From 30701661cd81683641d28ab4c8b070c1d520bb24 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Sun, 4 Feb 2018 20:23:37 -0800 Subject: [PATCH 2/5] update package-lock.json --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb2ab65..48ea3ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "amqp10", - "version": "3.5.4", + "version": "3.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@types/node": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.3.0.tgz", - "integrity": "sha512-wNBfvNjzsJl4tswIZKXCFQY0lss9nKUyJnG6T94X/eqjRgI2jHZ4evdjhQYBSan/vGtF6XVXPApOmNH2rf0KKw==" + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.0.tgz", + "integrity": "sha512-zkYho6/4wZyX6o9UQ8rd0ReEaiEYNNCqYFIAACe2Tf9DrYlgzWW27OigYHnnztnnZQwVRpwWmZKegFmDpinIsA==" }, "JSONStream": { "version": "1.3.2", From 7b3038b5d2b5d5e0e6c41d857e7ddf5a65e4fc4e Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 8 Feb 2018 11:11:21 -0800 Subject: [PATCH 3/5] Added typings for sasl and the sasl handler --- typings/lib/sasl/sasl.d.ts | 17 ++++++++++++++ typings/lib/sasl/sasl_anonymous.d.ts | 7 ++++++ typings/lib/sasl/sasl_plain.d.ts | 8 +++++++ typings/lib/sasl/sasl_utils.d.ts | 35 ++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 typings/lib/sasl/sasl.d.ts create mode 100644 typings/lib/sasl/sasl_anonymous.d.ts create mode 100644 typings/lib/sasl/sasl_plain.d.ts create mode 100644 typings/lib/sasl/sasl_utils.d.ts diff --git a/typings/lib/sasl/sasl.d.ts b/typings/lib/sasl/sasl.d.ts new file mode 100644 index 0000000..a9b0e72 --- /dev/null +++ b/typings/lib/sasl/sasl.d.ts @@ -0,0 +1,17 @@ + +import Connection = require("../connection"); +import { SaslMechanism, Credentials, SaslHandler } from "./sasl_utils"; + +declare class Sasl { + + mechanism: SaslMechanism | string; + handler: SaslHandler; + receivedHeader: boolean; + + constructor(mechanism: SaslMechanism | string, handler: SaslHandler); + + negotiate(connection: Connection, credentials: Credentials, callback: Function): void; + + headerReceived(header: any): void; +} +export = Sasl; \ No newline at end of file diff --git a/typings/lib/sasl/sasl_anonymous.d.ts b/typings/lib/sasl/sasl_anonymous.d.ts new file mode 100644 index 0000000..6bb0041 --- /dev/null +++ b/typings/lib/sasl/sasl_anonymous.d.ts @@ -0,0 +1,7 @@ + +declare class SaslAnonymous { + + getInitFrame(): Promise; +} + +export = SaslAnonymous; \ No newline at end of file diff --git a/typings/lib/sasl/sasl_plain.d.ts b/typings/lib/sasl/sasl_plain.d.ts new file mode 100644 index 0000000..d14a78a --- /dev/null +++ b/typings/lib/sasl/sasl_plain.d.ts @@ -0,0 +1,8 @@ +import { Credentials } from "./sasl_utils"; + +declare class SaslPlain { + + getInitFrame(credentials: Credentials): Promise; +} + +export = SaslPlain; \ No newline at end of file diff --git a/typings/lib/sasl/sasl_utils.d.ts b/typings/lib/sasl/sasl_utils.d.ts new file mode 100644 index 0000000..2f11015 --- /dev/null +++ b/typings/lib/sasl/sasl_utils.d.ts @@ -0,0 +1,35 @@ +declare enum SaslMechanism { + PLAIN = 'PLAIN', + ANONYMOUS = 'ANONYMOUS', + NONE = 'NONE' +} + +declare interface Credentials { + user: string; + pass: string; +} + +declare interface SaslHandler { + /** + * Gets the content of the SASL-INIT frame to send to the server + * + * @returns {Promise<{mechanism: string; initialResponse: any; hostname?: string}>} + * A promise that will either be resolved with an object representing the content of a SASL-INIT frame or rejected with an error + * The response object shall have 3 properties: + * - 'mechanism' which is the name of the SASL mechanism being used (and must match the server's request) + * - 'initialResponse' which is the response that the server is (hopefully) expecting. + * - 'hostname' which is an optional hostname field you can use or let the library handle it. + */ + getInitFrame(): Promise<{mechanism: string; initialResponse: any; hostname?: string}>; + + /** + * Gets the response to a SASL-CHALLENGE from the server. + * + * @param {Object} challengeFrame The content of the SASL-Challenge frame. + * @returns {Promise} A promise that will either be resolved with the challenge response or rejected with an error. + * The challenge response is an object that must have a 'response' property and will be encoded in a SASL-RESPONSE frame. + */ + getResponseFrame(challengeFrame: any): Promise<{response: any; [x: string]: any}>; +} + +export { SaslMechanism, Credentials, SaslHandler }; \ No newline at end of file From b7ad8f285484e824e4c83fe083f7032fbc289e90 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 8 Feb 2018 11:12:31 -0800 Subject: [PATCH 4/5] Updated methods with support for session and added typings for a new method registerSaslHandler --- typings/lib/amqp_client.d.ts | 196 ++++++++++++++++++++--------------- 1 file changed, 114 insertions(+), 82 deletions(-) diff --git a/typings/lib/amqp_client.d.ts b/typings/lib/amqp_client.d.ts index b2466bc..64f19b3 100644 --- a/typings/lib/amqp_client.d.ts +++ b/typings/lib/amqp_client.d.ts @@ -10,6 +10,8 @@ import ReceiverLink = require("./receiver_link"); import SenderLink = require("./sender_link"); import _ReceiverStream = require("./streams/receiver_stream"); import _SenderStream = require("./streams/sender_stream"); +import Session = require("./session"); +import { SaslHandler } from "./sasl/sasl_utils"; /** * AMQPClient is the top-level class for interacting with node-amqp10. Instantiate this class, connect, and then send/receive @@ -44,91 +46,121 @@ import _SenderStream = require("./streams/sender_stream"); * does a best-effort job. See EventHubPolicy for a more complicated example, turning objects into UTF8-encoded buffers of JSON-strings. */ declare class AMQPClient extends EventEmitter { - policy: Policy; - - static ErrorReceived: "client:errorReceived"; - static ConnectionOpened: "connection:opened"; - static ConnectionClosed: "connection:closed"; - - /** - * Creates a new AMQPClient instance using DefaultPolicy. - * @constructor - */ - constructor(); - - /** - * Creates a new AMQPClient instance by overriding DefaultPolicy using given overrides. - * - * @param policyOverrides - Additional overrides for the default policy - * @constructor - */ - constructor(policyOverrides?: Policy.Overrides); - - /** - * Creates a new AMQPClient instance. - * - * @param policy - Policy to use for connection, sessions, links, etc. Defaults to DefaultPolicy. - * @param [policyOverrides] - Additional overrides for the provided policy - * @constructor - */ - constructor(policy: Policy, policyOverrides?: Policy.Overrides); - - /** - * Connects to a given AMQP server endpoint. Sets the default queue, so e.g. - * amqp://my-activemq-host/my-queue-name would set the default queue to - * my-queue-name for future send/receive calls. - * - * @param url - URI to connect to, right now only supports `amqp` and `amqps` as protocol. - */ - connect(url: string): Promise; - - /** - * Creates a sender link for the given address, with optional link policy. - * - * @param address An address to connect this link to. If not provided will use default queue from connection uri. - * @param [policyOverrides] Policy overrides used for creating this sender link - * @param [policyOverrides.name] Explicitly set a name for this link, this is an alias to [policyOverrides.attach.name] - */ - createSender(address: string, policyOverrides?: Policy.SenderLink): Promise; - - /** - * Creates a sender link wrapped as a Writable stream. - * - * @param {String} address Address used for link creation - * @param {Object} [policyOverrides] Policy overrides used for creating this sender link - */ - createSenderStream(address: string, policyOverrides?: Policy.SenderLink): Promise<_SenderStream>; - - - /** - * Creates a receiver link for the given address, with optional link policy. The - * promise returned resolves to a link that is an EventEmitter, which can be - * used to listen for 'message' events. - * - * @param {String} address An address to connect this link to. If not provided will use default queue from connection uri. - * @param {Object} [policyOverrides] Policy overrides used for creating this receiver link - * @param {String} [policyOverrides.name] Explicitly set a name for this link, this is an alias to [policyOverrides.attach.name] - */ - createReceiver(address: string, policyOverrides?: Policy.ReceiverLink): Promise; - - /** - * Creates a receiver link wrapped as a Readable stream - * - * @param {String} address Address used for link creation - * @param {Object} [policyOverrides] Policy overrides used for creating the receiver link - */ - createReceiverStream(address: string, policyOverrides?: Policy.ReceiverLink): Promise<_ReceiverStream>; - - /** - * Disconnect tears down any existing connection with appropriate Close - * performatives and TCP socket teardowns. - */ - disconnect(): Promise; + policy: Policy; + + static ErrorReceived: "client:errorReceived"; + static ConnectionOpened: "connection:opened"; + static ConnectionClosed: "connection:closed"; + + /** + * Creates a new AMQPClient instance using DefaultPolicy. + * @constructor + */ + constructor(); + + /** + * Creates a new AMQPClient instance by overriding DefaultPolicy using given overrides. + * + * @param policyOverrides - Additional overrides for the default policy + * @constructor + */ + constructor(policyOverrides?: Policy.Overrides); + + /** + * Creates a new AMQPClient instance. + * + * @param policy - Policy to use for connection, sessions, links, etc. Defaults to DefaultPolicy. + * @param [policyOverrides] - Additional overrides for the provided policy + * @constructor + */ + constructor(policy: Policy, policyOverrides?: Policy.Overrides); + + /** + * Connects to a given AMQP server endpoint. Sets the default queue, so e.g. + * amqp://my-activemq-host/my-queue-name would set the default queue to + * my-queue-name for future send/receive calls. + * + * @param url - URI to connect to, right now only supports `amqp` and `amqps` as protocol. + * @param [policyOverrides] - Additional overrides for the provided policy + */ + connect(url: string, policyOverrides?: Policy.Overrides): Promise; + + /** + * Creates a session for the current connection that can be associated with any + * new links on that connection + * + * @inner @memberof AMQPClient + * @param [policyOverrides] - Additional overrides for the provided policy + * @return {Promise} + */ + createSession(policyOverrides?: Policy.Overrides): Promise; + + /** + * Creates a sender link for the given address, with optional link policy. + * + * @param {String} address An address to connect this link to. If not provided will use default queue from connection uri. + * @param {Object} [policyOverrides] Policy overrides used for creating this sender link + * @param {String} [policyOverrides.name] Explicitly set a name for this link, this is an alias to [policyOverrides.attach.name] + * @param {Object} [session] A session for the current connection that can be associated with any + * new links on that connection + */ + createSender(address: string, policyOverrides?: Policy.SenderLink, session?: Session): Promise; + + /** + * Creates a sender link wrapped as a Writable stream. + * + * @param {String} address Address used for link creation + * @param {Object} [policyOverrides] Policy overrides used for creating this sender link + * @param {Object} [session] A session for the current connection that can be associated with any + * new links on that connection + */ + createSenderStream(address: string, policyOverrides?: Policy.SenderLink, session?: Session): Promise<_SenderStream>; + + + /** + * Creates a receiver link for the given address, with optional link policy. The + * promise returned resolves to a link that is an EventEmitter, which can be + * used to listen for 'message' events. + * + * @param {String} address An address to connect this link to. If not provided will use default queue from connection uri. + * @param {Object} [policyOverrides] Policy overrides used for creating this receiver link + * @param {String} [policyOverrides.name] Explicitly set a name for this link, this is an alias to [policyOverrides.attach.name] + * @param {Object} [session] A session for the current connection that can be associated with any + * new links on that connection + */ + createReceiver(address: string, policyOverrides?: Policy.ReceiverLink, session?: Session): Promise; + + /** + * Creates a receiver link wrapped as a Readable stream + * + * @param {String} address Address used for link creation + * @param {Object} [policyOverrides] Policy overrides used for creating the receiver link + * @param {Object} [session] A session for the current connection that can be associated with any + * new links on that connection + */ + createReceiverStream(address: string, policyOverrides?: Policy.ReceiverLink, session?: Session): Promise<_ReceiverStream>; + + /** + * Disconnect tears down any existing connection with appropriate Close + * performatives and TCP socket teardowns. + */ + disconnect(): Promise; + + /** + * Registers a new SASL mechanism to handle SASL challenges during authentication. This method is only used to register the SASL mechanism + * handler and the type of SASL mechanism used will still need to be specified in the `connect` section of the policy object. + * + * @param {string} mechanism Name of the mechanism used to authenticate - must match what the server sends in the SASL-Mechanism frame. + * @param {SaslHandler} handler Object that is going to handle SASL challenges and craft corresponding responses. + * The handler itself needs to implement 2 methods (getInitFrameContent and getChallengeResponseContent) + * that will be called during the SASL exchange. An example of such a SASL handler is provided in the `examples` folder. + */ + registerSaslMechanism(mechanism: string, handler: SaslHandler): void; } declare namespace AMQPClient { - export type ReceiverStream = _ReceiverStream; - export type SenderStream = _SenderStream; + export type ReceiverStream = _ReceiverStream; + export type SenderStream = _SenderStream; } export = AMQPClient; \ No newline at end of file From 47aae1ed8cd2f17342371db449c607f2c61ba4e0 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Thu, 8 Feb 2018 11:15:26 -0800 Subject: [PATCH 5/5] Added source and target properties to SenderLinkAttach and ReceiverLinkAttach --- typings/lib/policies/policy.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/typings/lib/policies/policy.d.ts b/typings/lib/policies/policy.d.ts index 762355d..d67fa62 100644 --- a/typings/lib/policies/policy.d.ts +++ b/typings/lib/policies/policy.d.ts @@ -115,6 +115,14 @@ declare namespace Policy { senderSettleMode?: number; maxMessageSize?: number; initialDeliveryCount?: number; + source?: { + address: string; + filter?: object; + }; + target?: { + address: string; + filter?: object; + } } export interface ReceiverLink { @@ -133,6 +141,14 @@ declare namespace Policy { receiverSettleMode?: number; maxMessageSize?: number; initialDeliveryCount?: number; + source?: { + address: string; + filter?: object; + }; + target?: { + address: string; + filter?: object; + } } export interface Address {